I want to use Android OS drawables instead of providing my own. How to access check mark icon? I'm looking for check mark without rectagnle arround.
In your Android/Java source code you can also refer to that same image like this: Resources res = getResources(); Drawable drawable = res. getDrawable(R.
myView. getBackgroundDrawable(); Returns the drawable setted in the view. You can extend View to make your own one, and override setBackgroundResource, save the ID inside an auxiliar var, and then call super method. Define a getter to return the auxiliar var and you will get the function you want.
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.
To access system provided resource, just access R.java file of Android.
for example:
android.R.drawable.checkbox_on_background // To access drawable resource
android.R.color.black // To access color resources
android.R.dimen.colorstrip_height; // To acess dimension resources
If you are using Android 2.3 Gingerbread then you can access below in-built drawables:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With