Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use MediaSessionCompat and keep backward compatibility with RemoteControlClient?

Tags:

android

I want to replace my android RemoteControlClient class in my application with a new one using MediaSession, but that not working with API level < 21, MediaSessionCompat seem to work without crashing old devices, but no more ARTWORK or song infos on the LockScreen is displayed...

Any snippet or infos for me ?

Thanks all!

like image 418
anisite Avatar asked Oct 20 '14 20:10

anisite


1 Answers

As of revision 22 of the Support-v4 library, the source code for MediaSessionCompat shows that it now will automatically register and use a RemoteControlClient in API 14-20 devices before switching to MediaSession on API21+ devices.

like image 186
ianhanniballake Avatar answered Sep 29 '22 13:09

ianhanniballake