1
mirror of https://github.com/topjohnwu/Magisk synced 2024-11-13 20:54:12 +01:00

Open links in a new task

This commit is contained in:
tonymanou 2018-08-05 20:34:01 +02:00 committed by John Wu
parent 9e72317302
commit ebb7a9fcda
2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,5 @@
package com.topjohnwu.magisk.components;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
@ -42,9 +41,7 @@ public class MagiskInstallDialog extends CustomAlertDialog {
setNeutralButton(R.string.release_notes, (d, i) -> {
if (Data.magiskNoteLink.contains("forum.xda-developers")) {
// Open forum links in browser
Intent openLink = new Intent(Intent.ACTION_VIEW, Uri.parse(Data.magiskNoteLink));
openLink.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mm.startActivity(openLink);
Utils.openLink(activity, Uri.parse(Data.magiskNoteLink));
} else {
new MarkDownWindow(activity, null, Data.magiskNoteLink).exec();
}

View File

@ -91,6 +91,7 @@ public class Utils {
public static void openLink(Context context, Uri link) {
Intent intent = new Intent(Intent.ACTION_VIEW, link);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);
}