I need to play and stop my application through headset buttons… I found something about com.android.music.musicservicecommand , if I send a broadcast Intent doing
Intent intentStop;
intentStop = new Intent("com.android.music.musicservicecommand");
intentStop.putExtra("command", "stop");
SomafmApp.mycontext.sendBroadcast(intentStop);
media player stops. Do you have a sample code to intercept these events in my application? I found very little around internet, I start thinking that this method is deprecated, but maybe I’m wrong…
Thanks in advance
Found this http://android-developers.blogspot.com/2010/06/allowing-applications-to-play-nicer.html . It works great, and shows how to mantain a backward compatibility. Enjoy!