In many cases the ListView list data does not need to be refreshed all the time, just refresh the one with data changes, you can use Getchildat (index) to get a specified position view, and refresh the view.
1.getchaildAt is actually a range of values, which will return NULL if it goes out of range
The following ranges are given:>= listview.getfirstvisibleposition () && <= listview.getlastvisibleposition ();
You need to use getfirstvisibleposition () to get the first visible position, then use the current position-it, and then use the Getchildat to take a value! That is Getchildat (Position-listview. Getfirstvisibleposition ()) a value exists
2.getChildCount the value obtained from GetCount will be different
Listview.getcount () (actually Adapterview.getcount ()) returns the value returned by its adapter.getcount ().
That is, the total number of items contained in the Item.
Listview.getchildcount () (Viewgroup.getchildcount) returns the "number of child View contained" on the display plane.
When the item in the ListView is less than scrolling to display it all, the two are equivalent; Getchildcount () < GetCount () if the item number requires scrolling to browse all
where Getchildcount () returns the Item count that is currently visible
Android ListView Note the place