Skip to content

Instantly share code, notes, and snippets.

@mchelen
Created June 13, 2014 06:51
Show Gist options
  • Save mchelen/7274e02252fe29c2c313 to your computer and use it in GitHub Desktop.
Save mchelen/7274e02252fe29c2c313 to your computer and use it in GitHub Desktop.
antennapod notification buttons
Intent playButtonIntent = new Intent(
PlaybackService.this, PlaybackService.class);
playButtonIntent.putExtra(
MediaButtonReceiver.EXTRA_KEYCODE,
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE);
PendingIntent playButtonPendingIntent = PendingIntent
.getService(PlaybackService.this, 0,
playButtonIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Intent stopButtonIntent = new Intent(
PlaybackService.this, PlaybackService.class);
stopButtonIntent.putExtra(
MediaButtonReceiver.EXTRA_KEYCODE,
KeyEvent.KEYCODE_MEDIA_STOP);
PendingIntent stopButtonPendingIntent = PendingIntent
.getService(PlaybackService.this, 0,
stopButtonIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment