java.lang.RuntimeException: Unable to start activity ComponentInfo……AppCompat does not support the current theme features

There is a flashback problem during Android testing, and the following exception occurs:

 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 }

There are many reasons why the application cannot be started. Here is just one example. The solution to the problem here is:

In 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>

 

Don't disable the default theme's header layout in... (don't add such code)

 

<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325097302&siteId=291194637