问题
I had a scenario where I need to handle the clicks of each list item one by one with out clicking on that item. Is there a possiblity in which I can achieve this scenario. Can anyone help me is sorting out this issue.
Thanks in Advance
回答1:
mList.performItemClick(
myList.getAdapter().getView(position,null,null),position,myList.getAdapter().getItemId(position));
here position is your click position
or simply you can do this
mList.getAdapter().getView(position, null, null).performClick();
回答2:
You can retrieve your list item and call item.perFormClick()
来源:https://stackoverflow.com/questions/19274013/how-to-perform-autoclick-of-list-items-in-listview-android