Is there a way to have a play/pause button like Audible has in the notification? In the screenshot below, I show the closest thing I could find with the nb6 class. But it requires you to pull down the notification to show the actions. Contrast with the Audible notification above that.
Sub MediaStyle_Notification
Dim n As NB6
n.Initialize("default", Application.LabelName, "DEFAULT").SmallIcon(smiley)
n.AddButtonAction(smiley, "Action 1", MyService, "action 1") 'use different bitmaps...
n.AddButtonAction(smiley, "Action 2", MyService, "action 2")
n.AddButtonAction(smiley, "Action 3", MyService, "action 3")
n.MediaStyle
n.Build("Actions", "Actions", "tag", Me).Notify(1)
End Sub
Add to NB6:
B4X:
'Creates a media style notification
Public Sub MediaStyle As NB6
If IsBuilder Then
SetStyle("android.app.Notification$MediaStyle", CreateMap("setShowActionsInCompactView": Array As Int(0, 1, 2)))
End If
Return Me
End Sub
Finally, if you attach a MediaSession.Token using setMediaSession(MediaSession.Token), the System UI can identify this as a notification representing an active media session and respond accordingly (by showing album artwork in the lockscreen, for example).