开发者

Long click on rectangle

开发者 https://www.devze.com 2023-04-08 15:47 出处:网络
I created a view with rectangles which开发者_开发知识库 are clickable using the method onTouchEvent (using ACTION_DOWN motion). I want to enable a long click on the rectangle which open a dialog, and

I created a view with rectangles which开发者_开发知识库 are clickable using the method onTouchEvent (using ACTION_DOWN motion). I want to enable a long click on the rectangle which open a dialog, and I tried to do it using ACTION_UP, but then the dialog is presented only after I release the finger. How can I do it in the same way that OnLongClickListener of buttons do?


Set the onLongClickListener:

http://developer.android.com/reference/android/view/View.html#setOnLongClickListener(android.view.View.OnLongClickListener)

0

精彩评论

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

关注公众号