From 678ef5d9491d0504263198296735c43b633debe8 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 12 Feb 2021 11:40:25 +0100 Subject: [PATCH] Share as new task --- app/src/main/java/eu/faircode/email/Helper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index ab822981bf..ab1047ef65 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -550,7 +550,10 @@ public class Helper { // Build intent Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndTypeAndNormalize(uri, type); - intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | + Intent.FLAG_ACTIVITY_NEW_TASK | + Intent.FLAG_ACTIVITY_CLEAR_TASK); + if (!TextUtils.isEmpty(name)) intent.putExtra(Intent.EXTRA_TITLE, Helper.sanitizeFilename(name)); Log.i("Intent=" + intent + " type=" + type);