开发者

Replacement for MapView's OnLongPressListener

开发者 https://www.devze.com 2023-02-21 19:14 出处:网络
I have a mapView and I trying to capture 开发者_如何学Can event when I hold my finger on the map. The event similar to this one is \"onTouchListener\" but I want to hold the finger a couple of seconds

I have a mapView and I trying to capture 开发者_如何学Can event when I hold my finger on the map. The event similar to this one is "onTouchListener" but I want to hold the finger a couple of seconds before the event rise.

Thanks for your help.

Best, David.


You can set OnLongClickListener


I have use threads and the onTouchEvent(MotionEvent event). As the OnLongClickListener is for a click event and I want to keep it pressed. When I touch the screen a boolean variable is true, and a thread start counting until a limit. If I move my finger then event.ACTION_MOVE fires, the boolean variable became false and the Thread stops.

0

精彩评论

暂无评论...
验证码 换一张
取 消