0

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>

1 Answer 1

0

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.

5
  • Hi. No, i get the same problem.
    – Bombolo
    Apr 17, 2014 at 21:59
  • @user2030307 Did you try to test on other device? What's your current device?
    – Blo
    Apr 17, 2014 at 22:03
  • Make sur your style.xml inside values-v14 as the same parent theme.
    – Blo
    Apr 17, 2014 at 22:05
  • 2
    That's was the problem! the theme in the values- v14 folder was <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> but why this is happen? is a bug? Thanks!
    – Bombolo
    Apr 17, 2014 at 22:12
  • @user2030307 No, this is not a bug. It's the current way when you create an Android project. The SDK provides you the Light theme to lower API and DarkActionBar for higher API. Same with Holo theme. - Glad to help.
    – Blo
    Apr 17, 2014 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.