How to trigger play in spotify android app -


in latest version spotify remembers last played song. want automatically resume playback after event.

i tried using tasker.

i start app, tried send

  • keycode_media_play

and

  • keycode_media_play_pause

but both don't work.

keycode_media_play ==> opens google music keycode_media_play_pause ==> opens samsung mp3-player

both apps can't uninstalled.

additionally tried change default music player "default app manager". no change...

so searching way trigger "play" in spotify android directly.

smartphone: samsung galaxy s3, android 4.1.1 spotify android: 0.6.0.17

how sending intent keycode_media_play, , calling setcomponent method? had same issue, found need specify media button receiver (spotify) via setcomponent when creating action_media_button intent.

you can receiver calling getmediareceivers (of packagemanager) , passing in action_media_button intent object. provide list of packages register receive media button events. next, go through list, find 1 spotify (or player of choice) via resolveinfo , activityinfo.name, pass activityinfo.packagename , activityinfo.name new componentname object.

finally, pass componentname object setcomponent() method of action_media_button intent.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -