Bug 1351739 - Part 6 - Finish the WebAppActivity when closing via onDone. r?sebastian,walkingice
Custom and web app tabs behave as any other externally launched URLs, that is pressing the back button closes not only the activity, but the tab as well when reaching the beginning of session history. Therefore, we should finish the activity in this case (just as the CustomTabsActivity already does), so the next launch runs through the onCreate code path and opens a new tab again.
MozReview-Commit-ID: 14AhWkmb5O7
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -153,16 +153,21 @@ public class WebAppActivity extends Geck
Tabs.unregisterOnTabsChangedListener(this);
}
@Override
protected int getNewTabFlags() {
return Tabs.LOADURL_WEBAPP | super.getNewTabFlags();
}
+ @Override
+ protected void onDone() {
+ finish();
+ }
+
/**
* In case this activity is reused (the user has opened > 10 current web apps)
* we check that app launched is still within the same host as the
* shortcut has set, if not we reload the homescreens url
*/
@Override
protected void onNewIntent(Intent externalIntent) {
super.onNewIntent(externalIntent);