From 326cbd406461b727f9afd9ffe519732e2a20d1b3 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 6 Aug 2021 19:48:08 +0800 Subject: Fix Applying Material You notification cannot be dismissed. --- .../infinityforreddit/services/MaterialYouService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java index 583686fa..66bd4e0b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/MaterialYouService.java @@ -82,11 +82,17 @@ public class MaterialYouService extends Service { MaterialYouUtils.changeTheme(this, executor, new Handler(), redditDataRoomDatabase, customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences, amoledThemeSharedPreferences, () -> { - stopForeground(true); - stopSelf(); + stopService(); }); + } else { + stopService(); } return START_NOT_STICKY; } + + private void stopService() { + stopForeground(true); + stopSelf(); + } } \ No newline at end of file -- cgit v1.2.3