Damn Vegetables
Damn Vegetables

Reputation: 12504

How to use the drawables inside Android SDK?

There are lots of image (PNG) files in Android SDK. Many of them do not appear in the autocomplete list of Android Studio. A few months ago I asked a question (https://stackoverflow.com/questions/34839605/why-does-android-studio-not-recognise-some-system-drawables-in-the-android-sdk) about this, but I received no reply.

Is it that one is supposed just to copy the PNG files manually from the Android SDK and embed them to one's project?

For example, if I want to use the three dot image, is the correct way copying ic_menu_moreoverflow(DPI).png files from every sdk/platforms/android-23/data/res/drawable-(DPI) directory and paste them to my project? (Since there are many files for the same image, it does not seem so convenient though.)

Upvotes: 0

Views: 318

Answers (1)

gatlingxyz
gatlingxyz

Reputation: 753

If I understand what you're asking correctly, in XML you would use them like this:

@android:drawable/image_name_here

or, in code:

android.R.drawable.image_name_here

Upvotes: 1

Related Questions