From 47413edba35c0fa14b3099281cc627bbc015cb63 Mon Sep 17 00:00:00 2001 From: Phillip Hsu Date: Mon, 12 Sep 2016 01:46:04 -0700 Subject: [PATCH] Implement handling stop action in StopwatchNotificationService --- .../clock2/stopwatch/StopwatchNotificationService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/philliphsu/clock2/stopwatch/StopwatchNotificationService.java b/app/src/main/java/com/philliphsu/clock2/stopwatch/StopwatchNotificationService.java index 7c6a61d..a507e28 100644 --- a/app/src/main/java/com/philliphsu/clock2/stopwatch/StopwatchNotificationService.java +++ b/app/src/main/java/com/philliphsu/clock2/stopwatch/StopwatchNotificationService.java @@ -87,6 +87,11 @@ public class StopwatchNotificationService extends ChronometerNotificationService @Override protected void handleStopAction(Intent intent, int flags, long startId) { // TODO: Tell StopwatchFragment to stop itself.. perhaps with an Intent? + mPrefs.edit() + .putLong(StopwatchFragment.KEY_START_TIME, 0) + .putLong(StopwatchFragment.KEY_PAUSE_TIME, 0) + .putBoolean(StopwatchFragment.KEY_CHRONOMETER_RUNNING, false) + .apply(); stopSelf(); }