tags:

views:

128

answers:

2

In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?

+6  A: 

The icon is built-in with the Android development, you can access the image by using R.drawable.ic_dialog_menu_generic

Anthony Forloney
+4  A: 

While it may be possible to use it via android.R.drawable, you may want to find the image in the resources that come with your SDK ($ANDROID_HOME/platforms/$VERSION/data/res, where $ANDROID_HOME is where you have the SDK installed and $VERSION is a relevant Android API level). So, per Mr. Forloney's answer, you'll find that in, say, drawable-hdpi/ic_dialog_menu_generic.png in the aforementioned directory. Then, copy that image into your project. While it will add 5K to your project size, it will mean that the icon does not change based upon OEM or Android changes.

CommonsWare
But I thought using the version of drawables built into Android was the preferred method specifically because it DID change based on OEM or Android changes.
CaseyB
The core Android team expects you to be unhappy if you do that. For example, suppose that some OEM changes that icon to be bright red -- that may or may not look acceptable with the rest of the UI. The core Android team, Ms. Hackborn in particular, has recommended you maintain more control through copying the images into your project.
CommonsWare