Android : Change theme background of Popup menu

androidandroid-menuandroid-theme

My popum menu has a black background theme color when i click on an item in my action bar. I would like to change the theme of my popup menu to have a holo light (white) color.

How can i do this?

Here is my style.xml file, which is empty for the moment :

<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="android:Theme.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>

And extract of manifest :

<application
        android:name="com.app.ccccccc.activities.cccccccc"
        android:hardwareAccelerated="true"
        android:allowBackup="true"
        android:icon="@drawable/ic_action_blob"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

Best Answer

On the onClick of the action menu you can programatically write the code for setting the background color.

or use,

<style name="AppTheme" parent="android:Theme.Light">
    <item name="android:popupMenuStyle">@style/PopupMenu</item>
</style>

<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
    <item name="android:popupBackground">@android:color/white</item>
</style>

manifest.xml:

 <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
.............
</application>