Open with as new task

pull/182/head
M66B 5 years ago
parent 87b09c60b2
commit bac693e3e0

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

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

Loading…
Cancel
Save