I have an adapter that connected to ListView, e.g.
mJournalAdapter = new JournalAdapter();
journalEntryList.setAdapter(mJournalAdapter);
and I want to know inside of my JournalAdapter
if some view (item of ListView) is visible or not, is it possible?
Attaching the Adapter to a ListView // Construct the data source ArrayList<User> arrayOfUsers = new ArrayList<User>(); // Create the adapter to convert the array to views UsersAdapter adapter = new UsersAdapter(this, arrayOfUsers); // Attach the adapter to a ListView ListView listView = (ListView) findViewById(R. id.
just check if (cartlist. size()<0) then yours list is Empty.!
To get which item was selected, there is a method of the ListView called getItemAtPosition.
If you know the postion of that item then you can use
int last = listView1.getLastVisiblePosition();
int first = listView1.getFirstVisiblePosition();
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