I am trying to set the foreground image on an image button. After some research, I came across this code sample:
One more short variant
views.setImageViewResource(R.id.button1, R.drawable.newbutton);