Bug 1351605 - update action bar when restoring r=sebastian
authorJulian_Chu <walkingice0204@gmail.com>
Thu, 06 Apr 2017 17:02:17 +0800
changeset 558317 5fcfe069fc1d87978ec024ebfc75ed787a0f5fea
parent 558316 0b86b3b9e630b6e5195212c8aa39e596cbca588c
child 558318 69c70ee0d199cc5130d0728ba8b74ff80f4b1bc1
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +0000
reviewerssebastian
bugs1351605
milestone55.0a1
Bug 1351605 - update action bar when restoring r=sebastian If the activity is restoring, onTabChanged might not be called. To update title from existing Tab data in onResume. MozReview-Commit-ID: 3LqQ6HDh7Dc
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -200,16 +200,19 @@ public class CustomTabsActivity extends 
 
     @Override
     public void onResume() {
         if (lastSelectedTabId >= 0) {
             final Tabs tabs = Tabs.getInstance();
             final Tab tab = tabs.getTab(lastSelectedTabId);
             if (tab == null) {
                 finish();
+            } else {
+                // we are restoring
+                actionBarPresenter.update(tab);
             }
         }
         super.onResume();
     }
 
     // Usually should use onCreateOptionsMenu() to initialize menu items. But GeckoApp overwrite
     // it to support custom menu(Bug 739412). Then the parameter *menu* in this.onCreateOptionsMenu()
     // and this.onPrepareOptionsMenu() are different instances - GeckoApp.onCreatePanelMenu() changed it.