I am currently trying to develop a widget for an audio app. The widget includes a skipt to previous, a play and a skip to next button like the picture bellow.
I've followed this recommended approach and the play_pause button works correctly, but for the time being only if the playback has started.
To start the playback the user must 1) Open the app. 2) Choose a podcast. 3) Choose an episode to play. 4) Wait for the buffering to complete
Just setting the correct PendingIntent to the play_pause button did the work. So when this button is clicked my MediaSession.Callback.onPlay()
method is called.
Unfortunately that's not the case with the skip_to_next and skip_to_previous buttons. I want when the skip_to_next widget button is clicked the MediaSession.Callback.onSkipToNext()
to be called.
Here is my AppWidgetProvider class and the MediaBrowserService as well.