Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access all drawables in android?

Tags:

android

Only some drawables are accessible via the <ImageButton src="@+android:drawable/ syntax. For example expander_ic_maximized is not accessible, yet its clearly at http://androiddrawableexplorer.appspot.com/

its so frustrating to have to download the drawables and manually put them in my drawables folder....any ideas how to get around this???

like image 920
hunterp Avatar asked Jan 12 '11 20:01

hunterp


People also ask

How do I get to the drawable folder on android?

In Android Studio inside the res folder, one can find the drawable folder, layout folder, mipmap folder, values folder, etc. Among them, the drawable folder contains the different types of images used for the development of the application.

What are Drawables in android?

A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon . There are several different types of drawables: Bitmap File.


2 Answers

Android SDK has all images unpacked in the %SDK-FOLDER%/platforms/android-*/data/res/drawable-* folder. Just pick desired file and put it into your app resource.

like image 106
Olegas Avatar answered Oct 16 '22 11:10

Olegas


I realize it's a bit more work, but as a workaround you could just set the image resource programatically.

findViewById(R.id.ImageButton1).setImageResource(android.R.drawable.expander_ic_maximized)

like image 37
Snailer Avatar answered Oct 16 '22 10:10

Snailer