play/pause button image in notification ,Android

前端 未结 4 504
时光取名叫无心
时光取名叫无心 2020-12-08 22:32

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

4条回答
  •  既然无缘
    2020-12-08 23:17

    You have to set your notification.contentView to the new remoteView after it was changed so it can update the notification view itself.

    Meaning, after you receive the action in your BroadcastReceiver, re-build your notification with the desired button display ( pause or play )

    Hope this helps

提交回复
热议问题