93 Contributors: 4 Sunday, August 6, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial:
Roadmap: roadmap
Download eBook


Download android eBook


  • void mediaSessionCompat.setFlags(int flags)
  • void mediaSessionCompat.setMediaButtonReceiver(PendingIntent mbr)
  • void mediaSessionCompat.setCallback(MediaSessionCompat.Callback callback)
  • void mediaSessionCompat.setActive(boolean active)
  • MediaSessionCompat.Token mediaSessionCompat.getSessionToken()
  • void mediaSessionCompat.release()
  • void mediaSessionCompat.setPlaybackState(PlaybackStateCompat state)
  • void mediaSessionCompat.setMetadata(MediaMetadataCompat metadata)


For best practice, use the media-compat library. The library takes care of backward compatibility by translating media session methods to the equivalent methods on older platform versions when available.

Related Examples