Loader unable to retain itself during certain configuration change

前端 未结 4 612
渐次进展
渐次进展 2020-12-13 06:59

According to http://developer.android.com/guide/components/loaders.html, one of the nice thing about loader is that, it is able to retain its data during configuration chang

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 07:34

    If you are using FragmentManager's replace fragment technique this issue will happen.

    When you replace/remove the Fragment, the fragment is detached from the activity and since loaders are attached to the activity, the loaders will be recreated during orientation change.

    Try using FragmentManager's hide/show technique. May be this will help you.

提交回复
热议问题