Search code examples
androidandroid-themeandroid-min-sdk

android studio change theme to holo crashes app


I have an app I was working on. We wanted to upgrade the minSDK from Froyo to IceCream Sandwich (14) so we could use some of the newer features including the Holo Dark theme.

On StackOverflow we found steps for editing the build.gradle (Module: app) file and changed the minSDK to 14. We resync'd as requested. Then rebuilt the app. All compiled fine and ran on our connected device which is running 4.4.4

I then went to the styles.xml file and changed the AppTheme accordingly.

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

to

   <style name="AppTheme" parent="android:Theme.Holo">

also as recommended here.

I rebuild the app and it compiles fine. When it attempts to run on our connected device, I get a "The Application has Stopped" immediately.

I looked in the LogCat (per a Comment) and once I figured out what I was looking at, I found this line:

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Not sure what that means.

Am I missing something either on the "SDK" change or on the Theme?

Thanks Pete


Solution

  • Hey can you show your code for said activity? Especially the declaration. I've had this error before and it might have to do witht the fact that you aren't extending (extends) the right actionbar in your activity's declaration.

    For example :

    extends ActionBarActivity