简体   繁体   中英

In List view how many list items can load in android

Normally in ListView are used in android,but how many items can totally load in list view ? Is it possible to load more than 10,000 items ?

ListView itself will keep only a handful of view items in memory - those that are displayed on screen and possibly a few scrap items that are waiting to get recycled. ListView is not the limiting factor.

What is a limiting factor is the Adapter that feeds the ListView . If your adapter implementation keeps all data items in memory (eg an ArrayAdapter ), then you're bound to hit a limit at some point. There are other adapters such as CursorAdapter s that load the data items on demand and don't keep everything in memory. They scale further.

Of course there's usability. ListView is practically unusable for browsing through a list of 10000 items. If you really have that much data to display, you have an user interface design problem.

Try to use ViewHolder and convertView in View getView(int position, View convertView, ViewGroup parent) . You can load more than 10,000 items with low memory usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM