How set background drawable programmatically in Android

To set Background:

RelativeLayout layout =(RelativeLayout)findViewById(R.id.background);
layout.setBackgroundResource(R.drawable.ready);

Is the best way to do it?

15 Answers
15

Leave a Comment