Set Drawable programmatically Android example

// start_dark.png is stored in path	/package_name/res/drawable/start_dark.png
Drawable dw = getApplicationContext().getResources().getDrawable(R.drawable.start_dark);
Button hButtonStart = (Button)findViewById(R.id.buttonStart);
hButtonStart.setCompoundDrawablesWithIntrinsicBounds(dw, null, null, null);
This entry was posted in Android Examples Code and tagged , . Bookmark the permalink.


Comments are closed.



12,689 views