Issue
I have a fairly simple app in android which uses the Support Library to provide an Actionbar for devices running on APIs lower than 11, so my main activity extends the AppCompatActivity.
My current app theme is as follows:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
After running some tests and making sure the app works as expected, I've decided to set the theme for devices running on API level 14 and above as follows:
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
The app has been crashing on startup ever since.
The logcat shows that an exception is being thrown, which says the following:
You need to use a Theme.AppCompat theme (or descendant) with this activity.
Does it mean that I must use only the AppCompat themes, regardless of the device's API?
If not, then how should I solve this issue?
Solution
Does it mean that I must use only the AppCompat themes, regardless of the device's API?
Yes. Or, stop using appcompat-v7
, and inherit from Activity
.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.