android cursoradapter - How to find the scope of data to be shown in ListView -
i have list contains huge amount of data. filtering on text change little bit slow. thought why should filter data @ time. want filter limited data shown in listview. question how can know when listview ask next 20 data specific index?
more explanation: have listview name list, adapter, list contains 20 thousand data, , small list(filtered). override getview , provide data filtered list.
what want do?: when listview needs data (a scroll or new data event occurred), filter or search in big list until next 20 or 25 data, set them in filtered list , show them in listview using getview. how know when listview need next or previous 20 data?
you first sort data pass sorted data adapter , use viewholder pattern. not use sort in adapter. adapter calls visible indexes data in listview. viewholder links: http://myandroidsolutions.blogspot.com/2012/07/android-listview-tutorial.html
faster loading listview, faster viewholder method
creating viewholders listviews different item layouts
if need current visible range of listview, can set onscrolllistener listview , here can visible range , can call notifydatachanges method of adapter update listview.
Comments
Post a Comment