Reputation: 115
Notification media controls doesn't show on lock screen for Samsung Devices S10/A20 with Android 11, but for other devices different than Samsung works well.
This code doesn't allow to show it on Lock Screen but if I remove it, works without any style:
setStyle(
MediaStyle()
.setMediaSession(sessionToken)
.setShowActionsInCompactView(*actionsToShow.toIntArray())
)
I'm using NotificationCompat.Builder to create the notification.
I would like to know how can I fix that?
Thanks in advance
Upvotes: 0
Views: 769
Reputation: 11
I had the same issue. My solution was to set the corresponding playback state on my media session:
mediaSession.setPlaybackState(
PlaybackStateCompat.Builder()
.setState(PlaybackStateCompat.STATE_PLAYING, 0, 1f)
.build()
)
Same goes for PlaybackStateCompat.STATE_PAUSED
Upvotes: 1