Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 673ce42

Browse files
fix trackball long press timeout calling the main thread method on a background thread
1 parent f6bfa07 commit 673ce42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.graphics.PointF;
44
import android.os.Handler;
5+
import android.os.Looper;
56
import android.support.annotation.NonNull;
67
import android.view.KeyEvent;
78
import android.view.MotionEvent;
@@ -204,7 +205,7 @@ boolean onTrackballEvent(MotionEvent event) {
204205
currentTrackballLongPressTimeOut = null;
205206
}
206207
currentTrackballLongPressTimeOut = new TrackballLongPressTimeOut();
207-
new Handler().postDelayed(currentTrackballLongPressTimeOut,
208+
new Handler(Looper.getMainLooper()).postDelayed(currentTrackballLongPressTimeOut,
208209
ViewConfiguration.getLongPressTimeout());
209210
return true;
210211

0 commit comments

Comments
 (0)