Tonton MyTV dilengkapi intisari rancangan pada smart TV bermula RM4.99 sebulan. Selanjutnya →

ActionBarImplBase can only be used with a compatible window decor layout

Khamis, 6 November 2014, 9:03 pm0

ActionBarImplBase can only be used with a compatible window decor layout

This error occured in android 2.3 if you’re trying to use ActionBar feature on theme that disable ActionBar

Let’s say you define a style that enable actionbar overlay mode

<style name="MyTheme" parent="Theme.AppCompat">
     <item name="android:windowActionBarOverlay">true</item>
     <item name="windowActionBarOverlay">true</item>
</style>

Then one style extends this base style, but disable the actionbar

<style name="MyDifferentTheme" parent="MyTheme">
     <item name="android:windowActionBar">false</item>
     <item name="windowActionBar">false</item>
</style>

This will cause the crash. To fix it, the new style either need to extend different parent style, or disable the actionbar feature

<style name="MyDifferentTheme" parent="MyTheme">
     <item name="android:windowActionBar">false</item>
     <item name="windowActionBar">false</item>
     <item name="android:windowActionBarOverlay">false</item>
     <item name="windowActionBarOverlay">false</item>
</style>

Tulis komen: