October 2018
Intermediate to advanced
464 pages
15h 17m
English
There are four steps to setting this up:
Steps 4 and 1 work together as the callback will only get the events set in the PlayBackState.
Since we're not actually controlling any playback in this recipe, we just demonstrate how to respond to the hardware events. You'll want to implement actual functionality in PlayBackState and include a call to setState() after the setActions() call.
This is a very nice example of how the changes to the API can make things easier. And since the new MediaSession and PlaybackState were rolled ...