Janusz Janusz - 5 days ago 5
Android Question

How to get the first visible View from an Android ListView

Is there a way to get the first visible View out of the ListView in Android?

I can get the data that backs the first View in the Adapter but it seems I can't get the first View in ListView.

I want to change the first visible view after a scroll action finished. I know that I should not save references to the view.

Answer

Actually ListView items are just children of ListView. So first visible ListView item is:

listView.getChildAt(0)
Comments