public void setBackgroundResource (int resid)
Set the background to a given resource. The resource should refer to a Drawable object or 0 to remove the background.
So how do I refer to a Drawable object by an int id?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The common use case is
The R class contains an auto-generated int reference to each drawable resource in the project folder.
This has no use if you generate your
Drawablein code or from any other source than the projects resources (that’s why it’s called setBackgroundRESOURCE()).