Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:22:13+00:00 2026-05-31T05:22:13+00:00

I have icons for my Android menu. On Android 3+ I’m using a black

  • 0

I have icons for my Android menu. On Android 3+ I’m using a black ActionBar so the icons are white. However, on Android 2.x the menu is inherently white which means the icons are nearly invisible. How can I use different menu icons for different versions? I’m assuming I can do it using different drawable directories like res/drawable-mdpi-v11, but I’m wondering if there is another way so I don’t have to create a bunch of different directories as I add versions or pixel densities.

EDIT: I put dark versions in res/drawable-mdpi and res/drawable-hdpi for use with Android 2.x and I put light versions in res/drawable-mdpi-v11 and res/drawable-hdpi-v11 for use with Android 3.x and higher, but my Android 2.1 (sdk 7) emulator is still showing the light version.

Any idea why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:22:14+00:00Added an answer on May 31, 2026 at 5:22 am

    You can Select a theme based on platform version, as outlined in the Styles and Themes dev guide. Define a style in your res/values/styles.xml like this:

    <style name="ThemeSelector" parent="android:Theme.Light">
        ...
    </style>
    

    Then in a res/values-v11/ folder, select your theme (probably Holo, if you’re dark)

    <style name="ThemeSelector" parent="android:Theme.Holo">
        ...
    </style>
    

    Then add icons to that style. For instance, here’s a snippet from the styles.xml file from the HoneycombGallery sample application.

    <style name="AppTheme.Dark" parent="@android:style/Theme.Holo">
        ...
        <item name="menuIconCamera">@drawable/ic_menu_camera_holo_dark</item>
        <item name="menuIconToggle">@drawable/ic_menu_toggle_holo_dark</item>
        <item name="menuIconShare">@drawable/ic_menu_share_holo_dark</item>
    </style>
    

    The bottom 3 elements are all icons in the drawable directories. You’ll still need at least one folder per resolution-specific set of icons, but you can combine the light & dark icons into the same folder, but you won’t have to have different folders of icons for each platform version. Also, you’ll need to list them as references in the values/attrs.xml file, like this:

    <resources>
      <declare-styleable name="AppTheme">
        <attr name="listDragShadowBackground" format="reference" />
        <attr name="menuIconCamera" format="reference" />
        <attr name="menuIconToggle" format="reference" />
        <attr name="menuIconShare" format="reference" />
      </declare-styleable>
    </resources>
    

    At which point you’ll be able to refer to them within your layout XML using the “?attr/NameOfYourDrawable” dereference, like this:

    <item android:id="@+id/menu_camera"
          android:title="@string/camera"
          android:icon="?attr/menuIconCamera"
          android:showAsAction="ifRoom" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SOLVED: I was using icons from sdk v9 (Android 2.3 Gingerbread) which seems to
In the guidelines found in http://developer.android.com/guide/practices/ui_guidelines/index.html for menu and status icons, we have distinctive
I have these 3 icons enclosed in separate DIVs all of which are enclosed
I would like to have information about the icons which are displayed alongside the
I have a page which has a rectangular area with text and icons in
I'm using the ActionBar. I'd like to have a refresh progress spinner on the
I recently started using android actionbars and contextual action bars (CAB). I have just
I have the following menu layout in my Android app: <?xml version=1.0 encoding=utf-8?> <menu
Background: I am using Eclipse to develop an Android app. I have an xml
I have this menu.xml <?xml version=1.0 encoding=utf-8?> <menu xmlns:android=http://schemas.android.com/apk/res/android> <item android:id=@+id/refresh android:title=Actualizar android:icon=@android:drawable/ic_menu_refresh></item> <item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.