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

萝らか妹 提交于 2019-11-30 22:47:51

You are using an ActionBarActivity, which requires an AppCompat theme. I'm not sure how you'd do this with Titanium, but you'd either need to switch to an AppCompat theme or use a regular Activity (which shouldn't be a problem if you're targeting 11 or above).

Sam

ok please try this,

Add this attribute to your activity

android:theme="@style/Theme.AppCompat"

I know it's very only question but you should include parent theme into your style.

   <!-- Base application theme. Transparent 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>
    </style>


    <style name="Transparent" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">false</item>
    </style>
Vipin Yadav

Simply change the ActionBarActivity to Activity or FragmentActivity

velraj

write the code in style-v11 folder

 name="AppBaseTheme" parent="Theme.AppCompat.Light"

and in styles-v14 folder

 name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"

It's a bit embarrassing to admit how I've encountered this error, but in a hope to save someone an hour or hair pulling - for me it was a stray ">" that I mistakenly copied into my AndroidManifest:

   <application
    android:name=".MyApplication"
    android:allowBackup="true"
    android:fullBackupContent="@xml/my_backup_rules">
    android:hardwareAccelerated="true"
    android:icon="@mipmap/icon_l"
    android:label="@string/app_name"
    android:requiredForAllUsers="true"
    android:supportsRtl="true"
    android:theme="@style/MyAppTheme">

Too easy to miss if you have a very large manifest - the compiler doesn't complain.

Delete all the styles in the library project. Specify Style folder only in main project not in library project. It worked for me :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!