Bug 1351739 - Part 6 - Finish the WebAppActivity when closing via onDone. r?sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 02 Apr 2017 15:43:31 +0200
changeset 559304 6e4780dcca94a79ea4019c42bd85a41dcab66c76
parent 559303 894a303cfb8a0ec1386d9c477e564b641305a3bb
child 559305 2bdf7c7b5eef97ed213a8b0c71337300a8cd6e80
push id53051
push usermozilla@buttercookie.de
push dateSun, 09 Apr 2017 17:35:56 +0000
reviewerssebastian
bugs1351739
milestone55.0a1
Bug 1351739 - Part 6 - Finish the WebAppActivity when closing via onDone. r?sebastian 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
mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -136,16 +136,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);