diff --git a/app/src/main/java/com/cappielloantonio/play/service/MusicService.java b/app/src/main/java/com/cappielloantonio/play/service/MusicService.java index e805b12a..7b142094 100644 --- a/app/src/main/java/com/cappielloantonio/play/service/MusicService.java +++ b/app/src/main/java/com/cappielloantonio/play/service/MusicService.java @@ -156,7 +156,7 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); mediaButtonIntent.setComponent(mediaButtonReceiverComponentName); - PendingIntent mediaButtonReceiverPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0); + PendingIntent mediaButtonReceiverPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, PendingIntent.FLAG_IMMUTABLE); mediaSession = new MediaSessionCompat(this, getResources().getString(R.string.app_name), mediaButtonReceiverComponentName, mediaButtonReceiverPendingIntent); mediaSession.setCallback(new MediaSessionCompat.Callback() {