Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Error trying to change the background of an actionbar
    primarykey
    data
    text
    <p>I am trying to do change the background color of the action bar. I am following tutorial from this site: <a href="http://developer.android.com/training/basics/actionbar/styling.html" rel="nofollow">http://developer.android.com/training/basics/actionbar/styling.html</a> <br />Chapter on Styling the action bar</p> <p>I receive an error which I can't work out the origin of. The error is on this line of code</p> <pre><code>Android Manifest.xml android:theme="@style/CustomActionBarTheme" </code></pre> <p>error: Error: No resource found that matches the given name (at 'theme' with value '@style/CustomActionBarTheme'). Could anybody explain why this line throws an error? <br /><br /></p> <p>Code: Android Manifest.xml </p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/CustomActionBarTheme" android:uiOptions="splitActionBarWhenNarrow" &gt; &lt;activity android:name="com.example.myfirstapp2.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.example.myfirstapp2.DisplayMessageActivity" android:label="@string/title_activity_display_message" android:parentActivityName="com.example.myfirstapp.MainActivity" &gt; &lt;meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.example.myfirstapp.MainActivity" /&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Code: themes.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;!-- the theme applied to the application or activity --&gt; &lt;style name="CustomActionBarTheme" parent="@style/Theme.Holo.Light.DarkActionBar"&gt; &lt;item name="android:actionBarStyle"&gt;@style/MyActionBar&lt;/item&gt; &lt;/style&gt; &lt;!-- ActionBar styles --&gt; &lt;style name="MyActionBar" parent="@style/Widget.Holo.Light.ActionBar.Solid.Inverse"&gt; &lt;item name="android:background"&gt;@drawable/actionbar_background&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>code: styles.xml</p> <pre><code>&lt;resources&gt; &lt;!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --&gt; &lt;style name="AppBaseTheme" parent="android:Theme.Light"&gt; &lt;!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --&gt; &lt;/style&gt; &lt;!-- Application theme. --&gt; &lt;style name="AppTheme" parent="AppBaseTheme"&gt; &lt;!-- All customizations that are NOT specific to a particular API-level can go here. --&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload