How do I get all the data for the current ListView, including the dropdown?

Source: Internet
Author: User

ListView ListView = Activity.getlistview ();
Gets only the list displayed on the current screen, but with the drop-down information, not on the current screen, but the drop-down shows the data is not available or available. Who knows how to get all the data currently included in the dropdown?
That is, a screen shows 7 messages, there are 10, so there will be a drop. But this only gets 7 of the current screen, not 10. How do I get all 10 articles?
I use: Activity.getlistadapter (), although can get 10 data, but the data obtained is set before, not the user click on the changed data, Activity.getlistadapter () is not still need to set something, To get the current data?

Let me summarize it myself:
Method One: Directly to the activity to adapter
ListAdapter listadapter = Activity.getlistadapter ();
The data obtained is not the user's change from the interface, but the initial data that you initially set
Method Two: Get the listview listview = Activity.getlistview ();
And then
for (int i=0;i<listview.getchildcount (); i++) {
View view = Listview.getchildat (i);
。。。。
The data obtained is only on the current interface, not all
Method Three: First get the ListView ListView = Activity.getlistview ();
Then get:
ListAdapter listadapter = Listview.getadapter ();
for (int l=0;l<listadapter.getcount (); l++) {
View view = Listadapter.getview (l, NULL, NULL);
。。。。
This will allow you to get all the data and the latest data

Excerpt from: http://blog.sina.com.cn/s/blog_5da93c8f0100ts84.html

How do I get all the data for the current ListView, including the dropdown?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.