Saturday, April 28, 2012

Finally got Pandora to close properly!

After months of scouring forums, Stack Overflow, and other sites to no avail, and trying many things, I finally found a way to make Pandora pause so I could kill it.  My solution is now documented here: http://stackoverflow.com/questions/10326017/how-to-stop-or-pause-pandora-and-spotify
I also discuss it on issue 105 here: http://code.google.com/p/a2dpvolume/issues/detail?id=105 .  Basically I tell Android that the headset jack (audio plug) just disconnected.  Many music players respond to this common Android Intent by pausing the music.  This removes the notify icon and allows my app to kill it too.  You don't even need to kill the app though as pausing is really good enough in most cases.  Either way it will stop playing and that is the important thing.

No comments:

Post a Comment