From 48b67453497712b7772fbb04fa17fff7542763a9 Mon Sep 17 00:00:00 2001 From: Kaartic Sivaraam Date: Mon, 2 Mar 2020 15:29:26 +0530 Subject: [PATCH] Open external links in same activity (#3395) It's common for users to expect that re-opening the app would allow them to "continue where they left off". This also applies for the case where they leave the app after opening an external link. It's natural for them to expect that they would see the webpage they left open when they re-open the app. This doesn't happen for our app as we open custom tabs in a separate activity. As a consequence, this makes the experience un-intuitive. Fix this by opening custom tabs in the same activity. Fixes: #2944 Co-authored-by: Adam Jones --- app/src/main/java/fr/free/nrw/commons/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/Utils.java b/app/src/main/java/fr/free/nrw/commons/Utils.java index 40d880cd3..06b04716c 100644 --- a/app/src/main/java/fr/free/nrw/commons/Utils.java +++ b/app/src/main/java/fr/free/nrw/commons/Utils.java @@ -145,7 +145,7 @@ public class Utils { builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right); CustomTabsIntent customTabsIntent = builder.build(); // Clear previous browser tasks, so that back/exit buttons work as intended. - customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); customTabsIntent.launchUrl(context, url); }