From 794a8519f028e8c60048f51dae2eec8637bdc4e0 Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 26 Jun 2016 14:14:40 -0300 Subject: [PATCH] Configure the open player intent on background notification --- .../java/co/mobiwise/library/radio/RadioPlayerService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/co/mobiwise/library/radio/RadioPlayerService.java b/library/src/main/java/co/mobiwise/library/radio/RadioPlayerService.java index ca91125..eb2810c 100755 --- a/library/src/main/java/co/mobiwise/library/radio/RadioPlayerService.java +++ b/library/src/main/java/co/mobiwise/library/radio/RadioPlayerService.java @@ -485,9 +485,14 @@ private void buildNotification() { * Intents */ Intent intentPlayPause = new Intent(NOTIFICATION_INTENT_PLAY_PAUSE); - Intent intentOpenPlayer = new Intent(NOTIFICATION_INTENT_OPEN_PLAYER); Intent intentCancel = new Intent(NOTIFICATION_INTENT_CANCEL); + /** + * Intent for opening the player by clicking at the notification + */ + Intent intentOpenPlayer = new Intent(getPackageManager().getLaunchIntentForPackage(getPackageName())); + intentOpenPlayer.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + /** * Pending intents */