Back to project page Billy.
The source code is released under:
GNU General Public License
If you think the Android project Billy 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 com.vibin.billy; /*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; public class MediaControl extends BroadcastReceiver { private static final String TAG = MediaControl.class.getSimpleName(); public MediaControl() {} @Override public void onReceive(Context context, Intent intent) { if (intent != null) { String action = intent.getAction(); if (Intent.ACTION_MEDIA_BUTTON.equals(action)) { if (PlayerService.isRunning) { Log.d(TAG,"passing media button data to service"); Intent serviceIntent = new Intent(context, PlayerService.class); serviceIntent.putExtra("id","key"); serviceIntent.putExtra("keyevent", intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT)); context.startService(serviceIntent); } } } else { throw new UnsupportedOperationException("Not yet implemented"); } } }