Skip to content

Commit 3bdaf0b

Browse files
jonathanmgrimmarun251
authored andcommitted
Explicitly creating the handler with Looper.mainLooper() so the client can be initialized not on the main thread (#31)
1 parent b4ad5fd commit 3bdaf0b

File tree

1 file changed

+2
-1
lines changed
  • launchdarkly-android-client/src/main/java/com/launchdarkly/android

1 file changed

+2
-1
lines changed

launchdarkly-android-client/src/main/java/com/launchdarkly/android/Foreground.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.content.Context;
77
import android.os.Bundle;
88
import android.os.Handler;
9+
import android.os.Looper;
910
import android.util.Log;
1011

1112
import java.util.List;
@@ -60,7 +61,7 @@ interface Listener {
6061
private static Foreground instance;
6162

6263
private boolean foreground = false, paused = true;
63-
private Handler handler = new Handler();
64+
private Handler handler = new Handler(Looper.getMainLooper());
6465
private List<Listener> listeners = new CopyOnWriteArrayList<Listener>();
6566
private Runnable check;
6667

0 commit comments

Comments
 (0)