I cannot seem to change the background image of my image button. Heres the code i\'m currently trying to use:
ImageButton imgButton = (ImageButton) findViewB
Make sure you are on same activity. If you are changing background of different activity first create the constructor then use object to change button.
Activity obj= new activity();
obj.imgButton.setBackgroundResource(R.drawable.tab2_selected);
and also check that oncreate() method has void return type if you are using only findviewbyid.