Android Question MediaSessions

Jmu5667

Well-Known Member
Licensed User
Longtime User

Jmu5667

Well-Known Member
Licensed User
Longtime User
Question:

In this line of code,
session.InitializeNewInstance("android.support.v4.media.session.MediaSessionCompat", Array(Context, "MSC", Null, Null))
, "MSC", whta does it refer to and cann it be change and if so what can I change it to.

Regards

John.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It's just a Shortname Tag that is used for debugging. It can be anything
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi All

Attached is a sample program that works on the following API levels;

15,19,21


upload_2016-1-25_14-58-41.png
upload_2016-1-25_14-59-34.png
upload_2016-1-25_15-0-40.png
upload_2016-1-25_15-1-35.png


@Erel
@stevel05
@lemonisdead


Regards

John.
 

Attachments

  • headphone.zip
    13.4 KB · Views: 347
  • upload_2016-1-25_15-0-10.png
    upload_2016-1-25_15-0-10.png
    6.9 KB · Views: 313
  • upload_2016-1-25_15-1-20.png
    upload_2016-1-25_15-1-20.png
    6.9 KB · Views: 315
Last edited:
Upvote 0

woodpecker

Member
Licensed User
Longtime User
Just been playing with this, using a bluetooth receiver I can only get it to work with the play/pause key, is it possible to detect the MEDIA_NEXT and MEDIA_PREVIOUS keys as well?
 
Upvote 0

woodpecker

Member
Licensed User
Longtime User
Just noticed, if I switch out of the app and back in, I can get the MEDIA_NEXT or MEDIA_PREVIOUS key to register but only for one single click then both become non-responsive and only the play/pause button continues to respond. Any ideas?
 
Upvote 0
Top