What is difference between getCount()
and getChildCount()
in ListView
?
getCount()
returns you a count of items in Adapter (total in list), getChildCount()
is a ViewGroup
method that returns you number of subviews. ListView
actively reuses views so if your list has 1000 items getCount()
will return 1000, getChildCount()
- around 10 or so...
getCount()
is the number of items in the adapter while getChildCount()
refers to the ViewGroup's method that returns the number of the views that this view contains.
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