I\'m trying to change the image of the ImageButton programmatically.
I\'m trying to copy this code, but the setBackgroundDrawable is already deprecated.
Using Kotlin, you can do this:
val myImageButton = ImageButton(context).apply({ background = null setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_save_black_24px)) })