我需要播放和停止通過耳機按鍵我的應用程序...我發現一些有關com.android.music.musicservicecommand,如果我發送一個廣播意圖做如何在Android中攔截廣播mediaplayer事件?
Intent intentStop;
intentStop = new Intent("com.android.music.musicservicecommand");
intentStop.putExtra("command", "stop");
SomafmApp.mycontext.sendBroadcast(intentStop);
媒體播放器停止。你有一個示例代碼來攔截我的應用程序中的這些事件嗎?我發現周圍的網絡很少,我開始思考,這種方法已被棄用,但也許我錯了......
在此先感謝
感謝您的回答,但今天早上發現了更好的東西...看看我的回答^^ – Erenwoid