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

Commit 42c0fe86 authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 2908851 - ActionBar does not get initialized if

set/addContentView is never called.

Fix bugs around lazy initialization of ActionBar in Activities.

Change-Id: I39a4216a7f6b0051adc4a669b8f921f94148e1db
parent 368f3843
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1749,12 +1749,10 @@ public class Activity extends ContextThemeWrapper
    /**
     * Retrieve a reference to this activity's ActionBar.
     *
     * <p><em>Note:</em> The ActionBar is initialized when a content view
     * is set. This function will return null if called before {@link #setContentView}
     * or {@link #addContentView}.
     * @return The Activity's ActionBar, or null if it does not have one.
     */
    public ActionBar getActionBar() {
        initActionBar();
        return mActionBar;
    }
    
@@ -4093,6 +4091,7 @@ public class Activity extends ContextThemeWrapper
    }

    public ActionMode onStartActionMode(ActionMode.Callback callback) {
        initActionBar();
        if (mActionBar != null) {
            return mActionBar.startActionMode(callback);
        }