Android Open Source - EnklawaPlayer Media Button Receiver

From Project

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.

Java Source Code

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() {

  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();
      Log.d(TAG, "Recived keycode: " + keycode);

Java Source Code List