Open with as new task

This commit is contained in:
M66B 2020-06-18 13:53:32 +02:00
parent 87b09c60b2
commit bac693e3e0
2 changed files with 7 additions and 1 deletions

View File

@ -5738,7 +5738,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override
public void onClick(DialogInterface dialog, int which) {
Uri uri = Uri.parse(etLink.getText().toString());
Helper.view(context, uri, true);
Helper.view(context, uri, true, true);
}
})
.setNegativeButton(android.R.string.cancel, null)

View File

@ -483,11 +483,17 @@ public class Helper {
}
static void view(Context context, Uri uri, boolean browse) {
view(context, uri, browse, false);
}
static void view(Context context, Uri uri, boolean browse, boolean task) {
Log.i("View=" + uri);
if (browse || !hasCustomTabs(context, uri)) {
try {
Intent view = new Intent(Intent.ACTION_VIEW, uri);
if (task)
view.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(getChooser(context, view));
} catch (Throwable ex) {
Log.e(ex);