Back to project page EnklawaPlayer.
The source code is released under:
GNU General Public License
If you think the Android project EnklawaPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package macbury.pod.receivers; //ww w. j a v a 2 s .c o m import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import android.view.KeyEvent; import macbury.pod.managers.App; public class MediaButtonReceiver extends BroadcastReceiver { private static final String TAG = "MediaButtonReceiver"; public MediaButtonReceiver() { } @Override public void onReceive(Context context, Intent intent) { KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event.getAction() == KeyEvent.ACTION_DOWN) { int keycode = event.getKeyCode(); context.startService(App.current().intents.playerHandleRemoteControlClient(keycode)); Log.d(TAG, "Recived keycode: " + keycode); } } }