In fragment tabhost listView loading everytime on tab click

霸气de小男生 提交于 2019-12-24 16:17:31

问题


In my android app, I am using three tabs with three different fragments containing listviews. My problem is, 1) Listview in all fragment is loading (initialising) every time on tab click

2) I am using lazy loading for pagination (load more items at bottom on scroll), and in this case for first time loading listview with data from server not showing progress bar but on click on listview/or blank view, progress bar will be visible. So is there any different library for avoiding this.

Thank you in advance.


回答1:


set view pager off screen limit

pager.setOffscreenPageLimit(2);


来源:https://stackoverflow.com/questions/29965611/in-fragment-tabhost-listview-loading-everytime-on-tab-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!