Skip to content

Commit

Permalink
Closes #774
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantcheese committed Mar 7, 2020
1 parent 5bde49d commit 7c5f359
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,19 @@ public int onStartCommand(Intent intent, int flags, int startId) {

if (extras.getBoolean(CANCEL_KEY)) {
postToEventBus(new SavingCancelRequestMessage());
startForeground(NOTIFICATION_ID, new Notification());
stopSelf();
return START_NOT_STICKY;
} else {
doneTasks = extras.getInt(DONE_TASKS_KEY);
totalTasks = extras.getInt(TOTAL_TASKS_KEY);
startForeground(NOTIFICATION_ID, getNotification());
return START_STICKY;
}
}

return START_STICKY;
startForeground(NOTIFICATION_ID, new Notification());
stopSelf();
return START_NOT_STICKY;
}

private Notification getNotification() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
Notification notification = createNotification();
if (notification == null) {
Logger.d(TAG, "onStartCommand() createNotification returned null");

startForeground(NOTIFICATION_ID, new Notification());
stopSelf();
return START_NOT_STICKY;
}
Expand Down

0 comments on commit 7c5f359

Please sign in to comment.