Search code examples
javaandroidlistviewlistviewitem

ListView Item clicked Count (Android Java)


Is there a method to count in a ListView how often each Item Clicked ?


Solution

  • One solution is to create an array of integers that is the same size as the number of items in your listview.

    ListView has a method called onItemClick() that tells you which position is clicked. You can use this method to increment the value at the appropriate index of your array.