Bug 1351605 - update action bar when restoring draft
authorJulian_Chu <walkingice0204@gmail.com>
Thu, 06 Apr 2017 17:02:17 +0800
changeset 557605 0b2752a6dfe81dd4a224868e8fbd7d60bcb2b333
parent 557604 622deb817433c6aade8cf479dac3be5bedf68f9b
child 623100 5d8f6ea5ccae07dbb660955534bd3b5a9d5b463e
push id52766
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 02:12:09 +0000
bugs1351605
milestone55.0a1
Bug 1351605 - update action bar when restoring 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.