onLoadFinished not called on offscreen fragment until going back

淺唱寂寞╮ 提交于 2019-12-10 18:54:20

问题


I'm trying to implement List->Detail scheme with details pagination.

I've single Activity for ListView and different Activity with ViewPager. In FragmentStatePagerAdapter.getItem i instatniate new fragment for page and pass item id via setArguments Bundle.

After opening pager Activity two Fragment pages are created and onCreate, onCreateView, onActivityCreated being called.

BUT

onLoadFinished is called only for first Fragment (currently visible). If i go back onLoadFinished is called for second Fragment.

Strage thing is that when i swipe to second (onLoadFinished for third not called), back to first and again go forward to second OnLoadFinished is called for third fragment and every next - after going back and forward always next fragment is being fully created in advance.

Is this bug or feature? How fully loading can be forced?


回答1:


We've solved this by manually calling onStart and onResume in onCreate.. Then onLoadFinished is called



来源:https://stackoverflow.com/questions/18700436/onloadfinished-not-called-on-offscreen-fragment-until-going-back

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