標籤:bsp style.xml 方式 頭部 owa The ble style appcompat
Android測試時出現閃退的問題,出現了如下所示異常: java.lang.RuntimeException: Unable to start activity ComponentInfo{thonlon.example.cn.livetelecast/thonlon.example.cn.livetelecast.MainActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: false, windowNoTitle: false }啟動不了應用的原因有很多,這裡只是其中一例,這裡的問題解決方式是:在style.xml:<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<!--<item name="android:windowNoTitle">true</item>-->
<!--<item name="windowActionBar">false</item>-->
</style>
</resources>
中不要禁用預設主題的頭部布局……(不要加入這樣的代碼)
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
java.lang.RuntimeException: Unable to start activity ComponentInfo……AppCompat does not support the current theme features