android ActionBarImpl can only be used with a compatible window decor layout

在Activity中添加

requestWindowFeature(Window.FEATURE_ACTION_BAR);

requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);

并在AndroidManifast.xml中对Activity进行android:theme="@android:style/Theme.Holo.Dialog"

就会报: ActionBarImpl can only be used with a compatible window decor layout

解决方案

1:requestWindowFeature(Window.FEATURE_ACTION_BAR);与android:theme="@android:style/Theme.Holo.Dialog"不能同时使用

2:把android:theme="@android:style/Theme.Holo.Dialog"改成android:theme="@android:style/Theme.Holo"

 

你可能感兴趣的:(Actionbar)