From de761e291a89b55e97ad55f2af00f009a4ef1ca5 Mon Sep 17 00:00:00 2001 From: Phillip Hsu Date: Sat, 17 Sep 2016 16:23:28 -0700 Subject: [PATCH] Override isForeground() to return false --- .../clock2/timers/TimerNotificationService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/philliphsu/clock2/timers/TimerNotificationService.java b/app/src/main/java/com/philliphsu/clock2/timers/TimerNotificationService.java index ef6f4ae..1e1eef2 100644 --- a/app/src/main/java/com/philliphsu/clock2/timers/TimerNotificationService.java +++ b/app/src/main/java/com/philliphsu/clock2/timers/TimerNotificationService.java @@ -89,7 +89,15 @@ public class TimerNotificationService extends ChronometerNotificationService { @Override protected int getNoteId() { - return R.id.timer_notification_service; + // Since isForeground() returns false, this won't be called by the base class. + return 0; + } + + @Override + protected boolean isForeground() { + // We're going to post a separate notification for each Timer. + // Foreground services are limited to one notification. + return false; } @Override