简体   繁体   中英

Maximum item length in Android listview?

In an Android ListView , is there a maximum length that a node in the ListView can handle?

I am inflating an XML-file into a ListView , and in certain cases, the data coming into it may be rather large...

I could perhaps truncate the data and allow the user to click on the item and bring up the full text in a separate view, but what is the max length it can handle?

The ListView is populated in the memory of the device. In your ListAdapter -class you specify the input for the list.

I can only guess but I think, for one item, it can print as much as a String can hold. Depending on how many full Strings can be placed in the Memory of your Device/Emulator, you'll get some kind of Overflow I guess.

But a ListView is meant to show a lot of short data and redirect to the full data (like you said with the extra Activity). Also I don't think this will look good at all.

As far as I know, there is no hard limit for maximum text lenght in ListView. But you are limited by device resources (memory, cpu, etc.).

From UX point of view, it is not good idea to place long text in ListView. Make your users happy and split it to list=>detail.

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