This misled me a bit – it should be setImageResource instead of setBackgroundResource 🙂 !!
The following works fine :
ImageButton btn = (ImageButton)findViewById(R.id.imageButton1);
btn.setImageResource(R.drawable.actions_record);
while when using the setBackgroundResource the actual imagebutton’s image
stays while the background image is changed which leads to a ugly looking imageButton object
Thanks.