I want to be able to tell if a view is visible in my listview, which is populated by a custom CursorAdapter. How can I do this?
Close the current screen via finish() like in Android. Check if the widget is currently visible using bool isVisible() .
just check if (cartlist. size()<0) then yours list is Empty.!
Android ListView is a ViewGroup that is used to display the list of items in multiple rows and contains an adapter that automatically inserts the items into the list. The main purpose of the adapter is to fetch data from an array or database and insert each item that placed into the list for the desired result.
You can check whether a given position is visible, using getFirstVisiblePosition()
and getChildCount()
.
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