How to set background drawable programmatically in Android?

Posted by Pinki | Updated on

Want to set background drawable programmatically in Android? layout.setBackgroundResource(R.drawable.ready); is correct. Another way to achieve it is to use the following:

But I think the problem occur because you are trying to load big images.
Here is a good tutorial how to load large bitmaps.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers