Skip to content

Commit 6476620

Browse files
authored
Update BackgroundTaskManager.java
1 parent cf91270 commit 6476620

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

presentation/src/main/java/com/jorge/boats/xkcd/task/BackgroundTaskManager.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ public static void initialize(final @NonNull Context context) {
1515
}
1616

1717
private static void scheduleUserRetentionTask(final Context context) {
18-
UserRetentionService.enqueueWork(
18+
try {
19+
UserRetentionService.enqueueWork(
1920
context, UserRetentionService.class, 1000, new Intent());
21+
} catch (final SecurityException ignored) {
22+
// Service is not running, can't schedule anything
23+
}
2024
}
2125
}

0 commit comments

Comments
 (0)