I have a simple Activity and Retained Fragment, as well as an example Alex Lockwood blog post .
My activity happens like this inside onCreate() :
FragmentManager fm = getSupportFragmentManager(); retainedFragment = (GridFragment) fm.findFragmentByTag(RETAINED_FRAGMENT_TAG); // If the Fragment is non-null, then it is currently being // retained across a configuration change. if (retainedFragment == null) { retainedFragment = new GridFragment(); fm.beginTransaction().add(retainedFragment, RETAINED_FRAGMENT_TAG).commit(); }else{ list = retainedFragment.getList(); System.out.println(list.size());//OUTPUT 12 }
And my Fragments ' onAttach() :
@Override public void onAttach(Context activity) { super.onAttach(activity); mCallbacks = (TaskCallbacks) activity; System.out.println("here");
Now, at every turn of the screen, I have a very strange conclusion:
I / System.out: here
W / FragmentManager: moveToState: fragment state for GridFragment {95fc9db # 0 saveded_tag} not updated inline; expected condition 1 found 0
I / System.out: 12
Where does this strange warning come right between my inputs? How to deal with it? Thanks in advance!
source share