android - What is the difference between setBackgroundResource and setBackgroundDrawable -


could tell me difference between setbackgroundresource(resourceid) , setbackgrounddrawable(getresource().getdrawable(drawableid)) in android?

you can have @ android source code view class , find out there little difference!

public void setbackgroundresource(int resid) {     if (resid != 0 && resid == mbackgroundresource) {         return;     }      drawable d= null;     if (resid != 0) {         d = mresources.getdrawable(resid);     }     setbackground(d);      mbackgroundresource = resid; } 

and setbackground() calls through setbackgrounddrawable()...

public void setbackground(drawable background) {     //noinspection deprecation     setbackgrounddrawable(background); } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -