Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dd73b45 authored by Adam Powell's avatar Adam Powell
Browse files

Fix some lifecycle issues with populating the action bar's menu

Change-Id: I5f63df3260392b09fbb7120986702d01dac5906c
parent 22158e13
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -969,10 +969,6 @@ public class Activity extends ContextThemeWrapper
            mTitleReady = true;
            onTitleChanged(getTitle(), getTitleColor());
        }
        if (mWindow != null && mWindow.hasFeature(Window.FEATURE_ACTION_BAR)) {
            // Invalidate the action bar menu so that it can initialize properly. 
            mWindow.invalidatePanelMenu(Window.FEATURE_ACTION_BAR);
        }
        mCalled = true;
    }

+11 −2
Original line number Diff line number Diff line
@@ -2412,9 +2412,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                }
            } else {
                mActionBar = (ActionBarView) findViewById(com.android.internal.R.id.action_bar);
                if (mActionBar != null && mActionBar.getTitle() == null) {
                if (mActionBar != null) {
                    if (mActionBar.getTitle() == null) {
                        mActionBar.setWindowTitle(mTitle);
                    }
                    // Post the panel invalidate for later; avoid application onCreateOptionsMenu
                    // being called in the middle of onCreate or similar.
                    mDecor.post(new Runnable() {
                        public void run() {
                            invalidatePanelMenu(FEATURE_ACTION_BAR);
                        }
                    });
                }
            }
        }
    }