How can I change the first visible item in a list view (I searched a method such as setFirstVisiblePosition) ?
ListView.getFirstVisiblePosition()
Returns the position within the adapter's data set for the first item displayed on screen. Once you have the position, you can alter the item at that position in your adapter.
Presume my Adapter is binding a String[] to a ListView. I can use getFirstVisiblePosition()
method on the listview instance, which will return the index/position of the first visible item, I can then change my String item at the "index"th position and alter the list.
Have a look at this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With