Created
May 19, 2014 23:50
-
-
Save lzsucceed/66097338cf2aea10b503 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent playpause = new Intent(context, MusicPlayerService.class); | |
playpause.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.PLAY_PAUSE); | |
playpause.putExtra("from_widget", true); | |
PendingIntent pendingIntent4 = PendingIntent.getService(context, 0, playpause, | |
PendingIntent.FLAG_UPDATE_CURRENT); | |
views.setOnClickPendingIntent(R.id.playpause, pendingIntent4); | |
Intent prev = new Intent(context, MusicPlayerService.class); | |
prev.putExtra("from_widget", true); | |
prev.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.REWIND); | |
PendingIntent pendingIntent2 = PendingIntent.getService(context, 1, prev, PendingIntent.FLAG_UPDATE_CURRENT); | |
views.setOnClickPendingIntent(R.id.prev, pendingIntent2); | |
Intent next = new Intent(context, MusicPlayerService.class); | |
next.putExtra("from_widget", true); | |
next.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.NEXT_SONG); | |
PendingIntent pendingIntent3 = PendingIntent.getService(context, 2, next, PendingIntent.FLAG_UPDATE_CURRENT); | |
views.setOnClickPendingIntent(R.id.next, pendingIntent3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment