From 04af4e85ba7d6db596aada825704a3e843431781 Mon Sep 17 00:00:00 2001 From: tom79 Date: Tue, 20 Aug 2019 09:38:58 +0200 Subject: [PATCH] Fix issue #271 --- .../fedilab/android/services/LiveNotificationService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java b/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java index 98c4727de..6ee8e980a 100644 --- a/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java +++ b/app/src/main/java/app/fedilab/android/services/LiveNotificationService.java @@ -241,16 +241,15 @@ public class LiveNotificationService extends Service implements NetworkStateRece if (ex != null) { if( !canStartStream.containsKey(account.getAcct()+"@"+account.getInstance()) || canStartStream.get(account.getAcct()+"@"+account.getInstance())) { canStartStream.put(account.getAcct()+"@"+account.getInstance(),false); - Handler handler = new Handler(); - handler.postDelayed(new Runnable() { + Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(new Runnable() { @Override public void run() { startStream(account); canStartStream.put(account.getAcct()+"@"+account.getInstance(),true); } - - }, 15000); // 5000ms delay + }, 15000 ); } return; }