Question

I have a problem when starting an android project and choose the Holo light, should create a project with the action bar in white color. But I get the action bar in black (and sub menu too).

However if I open a submenu with the menu button instead that from the action bar, on the left bottom, the submenu appears with the style of the Light theme.

Why I get this strange problem?

This is the manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.actionbar"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="19" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.actionbar.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

and this is the style.xml:

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>
Was it helpful?

Solution

I think you forgot the @style/ property as follows:

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">  

Update from comments below: make sure that style.xml in res/values-v14/ as the same theme as the above snippnet code.
Let me know if this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top