Bug 1351739 - Part 6 - Finish the WebAppActivity when closing via onDone. r?sebastian,walkingice draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 02 Apr 2017 15:43:31 +0200
changeset 569638 566b6149b704c83f7042183bb923d1e7cd266694
parent 569637 6c49e349f10443a8657c0e9834cf4ce7fa13d6a0
child 569639 170289f80c1dfd6db0dea12ea219d3ffbb8eb9c6
push id56240
push usermozilla@buttercookie.de
push dateThu, 27 Apr 2017 18:44:39 +0000
reviewerssebastian, walkingice
bugs1351739
milestone55.0a1
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
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
@@ -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);