I have implemented music player which fires a custom notification when stream audio is playing.
Everything is working and I can play/pause the audio using the button
Why not using an ImageView instead of ImageButton? With ImageView, you can simply change its appearance with removeViews.setImageViewResource(R.id.button1, R.drawable.pause);
removeViews.setImageViewResource(R.id.button1, R.drawable.pause);