summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorPablo Guardiola <guardiola31337@gmail.com>2017-06-20 10:01:02 +0200
committerGitHub <noreply@github.com>2017-06-20 10:01:02 +0200
commit78426f1423ad3b739d7f7fa1fd7f248146281fa2 (patch)
tree43588433c9788d56c09ebcf78681535a920b218d /platform
parent985ff4cc1883d606b3770a34d384ade71f71bbdc (diff)
downloadqtlocation-mapboxgl-78426f1423ad3b739d7f7fa1fd7f248146281fa2.tar.gz
fix trackball long press timeout calling the main thread method on a background thread (#9305)
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java
index 7175242282..d1f01a30f7 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java
@@ -2,6 +2,7 @@ package com.mapbox.mapboxsdk.maps;
import android.graphics.PointF;
import android.os.Handler;
+import android.os.Looper;
import android.support.annotation.NonNull;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -204,7 +205,7 @@ final class MapKeyListener {
currentTrackballLongPressTimeOut = null;
}
currentTrackballLongPressTimeOut = new TrackballLongPressTimeOut();
- new Handler().postDelayed(currentTrackballLongPressTimeOut,
+ new Handler(Looper.getMainLooper()).postDelayed(currentTrackballLongPressTimeOut,
ViewConfiguration.getLongPressTimeout());
return true;