Skip to content

Commit 48b6745

Browse files
Open external links in same activity (commons-app#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: commons-app#2944 Co-authored-by: Adam Jones <jones_adam@rocketmail.com>
1 parent e68751f commit 48b6745

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/fr/free/nrw/commons/Utils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static void handleWebUrl(Context context, Uri url) {
145145
builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
146146
CustomTabsIntent customTabsIntent = builder.build();
147147
// Clear previous browser tasks, so that back/exit buttons work as intended.
148-
customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
148+
customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
149149
customTabsIntent.launchUrl(context, url);
150150
}
151151

0 commit comments

Comments
 (0)