在java android中获取触摸事件中的列表视图选择项索引

在java android中获取触摸事件中的列表视图选择项索引

问题描述:

我正在尝试使用ontouchlistener获取在listview中选择的项目。我知道onitemclicklistener,但我需要触摸事件中的项目索引(MotionEvent.ACTION_UP)。

I''m trying to get which item is selected in my listview using ontouchlistener. I know about onitemclicklistener, but I need item index in touch event (MotionEvent.ACTION_UP).

请检查此 [ LINK ]。我希望这对你有用。



干杯,

Sudhakar
Please check this [LINK]. I hope this is useful for you.

Cheers,
Sudhakar


我已经使用onclickevent解决它,并从那里获取所选项目
I''ve solved it using onclickevent, and getting selected item from there