Prototik / HoloEverywhere

NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE.
MIT License
2.18k stars 608 forks source link

When DIALOG_WHEN_LARGE theme is used, getSupportActionBar returns null #823

Open vincentjames501 opened 10 years ago

vincentjames501 commented 10 years ago

I'm applying the theme in my manifest

<activity
            android:name="PopUpActivity"
            android:theme="@style/Holo.Theme.DialogWhenLarge"
            android:label="@string/popup_title"/>

Result:

Null Pointer Exception on getSupportActionBar().setDisplayHomeAsUpEnabled(true); in onCreate

I've tried a bunch of other things as well such as manually calling

        setTheme(ThemeManager.DIALOG_WHEN_LARGE);

Result:

Null Pointer Exception on getSupportActionBar().setDisplayHomeAsUpEnabled(true); in onCreate

As well as manually calling

        supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);

Result:

Caused by: java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layout
            at com.android.internal.app.ActionBarImpl.init(ActionBarImpl.java:193)
            at com.android.internal.app.ActionBarImpl.<init>(ActionBarImpl.java:166)
            at android.app.Activity.initActionBar(Activity.java:1912)
            at android.app.Activity.setContentView(Activity.java:1966)
            at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:203)
            at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:116)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:73)
            at android.support.v4.app._HoloActivity.access$201(_HoloActivity.java:52)
            at android.support.v4.app._HoloActivity$1.justPost(_HoloActivity.java:393)
            at org.holoeverywhere.addon.IAddonAttacher$AddonCallback.post(IAddonAttacher.java:41)
            at org.holoeverywhere.addon.IAddonBasicAttacher.performAddonAction(IAddonBasicAttacher.java:152)
            at org.holoeverywhere.app.Activity.performAddonAction(Activity.java:349)
            at android.support.v4.app._HoloActivity.requestDecorView(_HoloActivity.java:385)
            at android.support.v4.app._HoloActivity.setContentView(_HoloActivity.java:414)
            at com.singlewire.cirrus.ComposeActivity_.setContentView(ComposeActivity_.java:48)
            at com.singlewire.cirrus.ComposeActivity_.onCreate(ComposeActivity_.java:36)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

I've also tried many other styles such as the following:

@style/Holo.Theme.DialogWhenLarge
@style/Holo.Theme.DialogWhenLarge.Light
@style/Holo.Theme.DialogWhenLarge.Light.DarkActionBar
@style/Holo.Theme.DialogWhenLarge.Light.NoActionBar

Result:

No Change
vincentjames501 commented 10 years ago

I should also note I'm using ActionBarCompat