How to use default Android drawables

Catalin Morosan picture Catalin Morosan · Jul 8, 2010 · Viewed 115.4k times · Source

What is the best approach when using default Android drawables? Should I use android.R.drawable or should I copy the drawables in my project and use R.drawable?

Is there any risk, that in a newer version of Android, some of the default drawables are removed or resized? Or, affect in some negative way, the look of my app? Also, which of the drawables in the Android source code are considered "stable" and should be relied on?

I'd rather not copy the drawables because I think that the look of the app should be consistent with the Android version used. So, for example, for version 1.6 it should use the default Android bitmaps for version 1.6.

Answer

Amjad Abu Saa picture Amjad Abu Saa · May 2, 2013

Java Usage example: myMenuItem.setIcon(android.R.drawable.ic_menu_save);

Resource Usage example: android:icon="@android:drawable/ic_menu_save"