fix trackball long press timeout calling the main thread method on a background thread (#9305)

This commit is contained in:
Pablo Guardiola
2017-06-20 10:01:02 +02:00
committed by GitHub
parent 985ff4cc18
commit 78426f1423

View File

@@ -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;