I want to programmatically remove the grey background in ImageButton. I tried many method of removing it like -
imageButton.setBackgroundDrawable(null);
but on implementing them, I don't get the ripple effect on the ImageButton on touch. (No highlighting on touch).
Is there any way to remove the background but preserve the ripple effect or highlight.
If android:background="?attr/selectableItemBackground"
this works than I believe this answer should solve your problem: