开发者

How to know the row position or id of a list view using gesture detector

i have a listview,now i want to 开发者_StackOverflowperform on each listview items.I am using GestureDetector.SimpleOnGestureListener,How can i detect that which item is clicked to do desired action. Plz Help me Out.


You are more likely to find people willing to help if you can post the code that you are currently using and tell about what kinds of problems it is having.

It is also somewhat unclear to me what you're asking so you'll also get better results if you can elaborate some.

Are you trying to capture only "clicks" as in finger touches that item in the list and then lifts back up without moving? Or are you trying to capture gestures like the swipe ("fling") that will move your home screen side to side?

If you're only trying to get clicks ListView has an onItemSelected() method that you can override and it will pass you the position as a parameter. No need for GestureDetector in this case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜