I\'m creating a custom theme for my Titanium application using this theme generator. But when I run my application it\'s crashing and my log says that I need appCompac
ok please try this,
Add this attribute to your activity
android:theme="@style/Theme.AppCompat"
Delete all the styles in the library project. Specify Style folder only in main project not in library project. It worked for me :)
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).
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.
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"
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>