Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access checkmark drawable in Android OS?

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.

like image 773
Kostadin Avatar asked Feb 13 '12 11:02

Kostadin


People also ask

How do you reference drawable Android?

In your Android/Java source code you can also refer to that same image like this: Resources res = getResources(); Drawable drawable = res. getDrawable(R.

How do you make a view drawable?

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.

What does drawable do 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.


1 Answers

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

Update:

If you are using Android 2.3 Gingerbread then you can access below in-built drawables:

  1. btn_check_buttonless_off.png enter image description here
  2. btn_check_buttonless_on.png enter image description here
like image 95
Paresh Mayani Avatar answered Oct 03 '22 17:10

Paresh Mayani