I\'m trying to change the image of the ImageButton programmatically.
I\'m trying to copy this code, but the setBackgroundDrawable is already deprecated.
your code is trying to change the background of the button. not its image. Those are two different things
((ImageButton) view).setImageResource(R.drawable.icon2);