diff --git a/Clover/app/src/main/java/org/floens/chan/core/watch/WatchNotifier.java b/Clover/app/src/main/java/org/floens/chan/core/watch/WatchNotifier.java index 52022328..4c6599a1 100644 --- a/Clover/app/src/main/java/org/floens/chan/core/watch/WatchNotifier.java +++ b/Clover/app/src/main/java/org/floens/chan/core/watch/WatchNotifier.java @@ -26,6 +26,7 @@ import android.support.v4.app.NotificationCompat; import org.floens.chan.ChanApplication; import org.floens.chan.R; +import org.floens.chan.core.ChanPreferences; import org.floens.chan.core.model.Pin; import org.floens.chan.core.model.Post; import org.floens.chan.service.WatchService; @@ -61,7 +62,7 @@ public class WatchNotifier { } public void onForegroundChanged() { - if (WatchService.getActivityInForeground()) { + if (WatchService.getActivityInForeground() && ChanPreferences.getWatchBackgroundEnabled()) { nm.cancel(NOTIFICATION_ID); } else { diff --git a/Clover/app/src/main/java/org/floens/chan/service/WatchService.java b/Clover/app/src/main/java/org/floens/chan/service/WatchService.java index 9868b67d..ed006742 100644 --- a/Clover/app/src/main/java/org/floens/chan/service/WatchService.java +++ b/Clover/app/src/main/java/org/floens/chan/service/WatchService.java @@ -163,8 +163,6 @@ public class WatchService extends Service { while (running) { Logger.d(TAG, "Loadthread loop"); - update(); - if (!running) return; @@ -180,6 +178,8 @@ public class WatchService extends Service { Logger.d(TAG, "Interrupted!"); } } else { + update(); + try { Thread.sleep(timeout); } catch (InterruptedException e) {