It worked for me.
listView.performItemClick( listView.getAdapter().getView(position, null, null), position, position);
use adapter to get view for item position. I do not need the remaining 2 parameters, so I left them zero. Leaving with null conversion causes the adapter to render a new view. This is a performance issue, but since it only happens once in a while, it will not have much effect. I do not need to specify a parent for anything, because I do not use it.
Position
- This is the place where your item is located. In addition, these 2 lines of code in front of your performItemClick function create the illusion of selecting a list item. They also ensure that the corresponding item is on the screen.
listView.requestFocusFromTouch(); listView.setSelection(position);
Steven Feb 03 2018-12-23T00: 00Z
source share