0

I have programmed a ListView with some elements. Now I want to know which element was clicked. So that I can say, when the first was clicked, do this, the second, do that.

So how do I know which element the user clicked?

Thanks

aromero
  • 25,681
  • 6
  • 57
  • 79

3 Answers3

0

I have done it with the position of the element.

0

Try setOnItemClickListener. This is a pretty basic question. Google is your friend. :-)

mhelvens
  • 4,225
  • 4
  • 31
  • 55
0

Use list.setOnListItemClickListener and use the index or position parameter that the listener passes :)

androidu
  • 4,678
  • 6
  • 36
  • 51