I am implementing ActionBar to set the color for text using this style script in xml but getting error when I run my application time does anybody have idea what I have missing
this is my style.xml file
<!-- Start with the Holographic Light theme -->
<style name="Theme.IOSched" parent="android:style/Theme.Holo.Light">
<item name="android:windowBackground">@drawable/window_background</item>
<item name="android:actionBarStyle">@style/ActionBar</item>
<!-- custom attributes
<item name="textHeaderMaxLines">@integer/text_header_max_lines</item>
<item name="trackAbstractMaxLines">@integer/track_abstract_max_lines</item>-->
</style>
<style name="Theme.IOSched.Home" parent="style/Theme.IOSched">
<item name="android:windowBackground">@drawable/window_background_home</item>
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@color/actionbar_background</item>
<item name="android:textColor">@color/accent_1</item>
<item name="android:titleTextStyle">@style/ActionBarText</item>
</style>
<style name="ActionBarText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"> <!-- getting here error-->
<item name="android:textColor">@color/accent_1</item>
<item name="android:textStyle">bold</item>
</style>
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Widget.ActionBar.Title'.
I tried to change target sdk to 13 but does not works!! then when I changed
compileSdkVersion 13
tocompileSdkVersion 14
is compiled successfully :)Make sure you've set your target API (different from the target SDK) in the Project Properties (not the manifest) to be at least 4.0/API 14.
AndroidManifest.xml:
and
Project Properties -> Project Build Target = 11 or above
These 2 things fixed the problem for me!
you can not give your own color and backgroud in item windowBackground. give your color in your /color.xml file.
This happens because in r6 it shows an error when you try to extend private styles.
Refer to this link
TextAppearance.Holo.Widget.ActionBar.Title
appears to have been added in API Level 13. Make sure your build target is set to 13, not just 11.