For an App I am working on, I\'m trying to get the children of a ListView. To do this I have the following piece of code:
View listItem = mListView.getChildA
You need method Adapter.getView():
final View view = mListView.getAdapter().getView(position, null, mListView);
UPDATE:
You need to create your method. Something like this:
public View getViewByPosition(int position, ListView listView) {
final int firstListItemPosition = listView.getFirstVisiblePosition();
final int lastListItemPosition = firstListItemPosition + listView.getChildCount() - 1;
if (position < firstListItemPosition || position > lastListItemPosition ) {
return listView.getAdapter().getView(position, null, listView);
} else {
final int childIndex = position - firstListItemPosition;
return listView.getChildAt(childIndex);
}
}