No longer creating a new instance of the app when clicking the notification. Also the widget will still stay clickable after a reboot.

This commit is contained in:
Karim Abou Zeid 2016-01-07 16:20:14 +01:00
commit 88a86312a1
4 changed files with 17 additions and 8 deletions

View file

@ -374,4 +374,8 @@ public class MusicPlayerRemote {
}
}
}
public static boolean isServiceAvailable() {
return musicService != null;
}
}

View file

@ -113,7 +113,8 @@ public class PlayingNotificationHelper {
private PendingIntent getOpenMusicControllerPendingIntent() {
Intent intent = new Intent(service, MainActivity.class);
return PendingIntent.getActivity(service, 0, intent, 0);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
return PendingIntent.getActivity(service, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
private void setUpExpandedPlaybackActions() {