From ff29a0cb99d5e8aedc66207080d7e83a7e2dc0dd Mon Sep 17 00:00:00 2001 From: Tobrun Date: Wed, 24 Jan 2018 11:28:47 +0100 Subject: [android] - create Handler using the main thread looper --- .../src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java index c033b1cbcb..987756876b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java @@ -1,6 +1,7 @@ package com.mapbox.mapboxsdk.offline; import android.os.Handler; +import android.os.Looper; import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -51,7 +52,7 @@ public class OfflineRegion { private byte[] metadata; // Makes sure callbacks come back to the main thread - private final Handler handler = new Handler(); + private final Handler handler = new Handler(Looper.getMainLooper()); /** * A region can have a single observer, which gets notified whenever a change -- cgit v1.2.1