Efficient ListView in android

后端 未结 3 652
[愿得一人]
[愿得一人] 2020-12-06 15:11

What is the best way of constructing a ListView that uses the least memory possible? This is important, because I met a few implementations and most of them is

相关标签:
3条回答
  • 2020-12-06 15:27

    Look at this code with description to increase the efficiency of lisview.

    Keep in mind when you have lots of data to show in listview then at a time do not load all data . First load 2o data then load another when listview reaches at end.

    This is also another way to increase the efficiency of listview.

    0 讨论(0)
  • 2020-12-06 15:34
    • recycle your views in getView()
    • use ViewHolder pattern
    • use lazy loading if you have a lot of data to fill the list with
    • use Cursor as underlying data instead of object list built from cursor if your data comes from database, you save memory by not creating additional objects.
    • see http://www.google.com/events/io/2010/sessions/world-of-listview-android.html
    • see http://android.amberfog.com/?p=296
    0 讨论(0)
  • 2020-12-06 15:38

    You will have to use the ViewHolder pattern.

    0 讨论(0)
提交回复
热议问题