viewpager绑定fragment_0, fragment_1, fragment_2
1. activity启动后,
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_0: onAttach();
fragment_0: onCreate();
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == true;
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_0: onCreateView();
fragment_0: onActivityCreated();
fragment_0: onStart();
fragment_1: onAttach();
fragment_1: onCreate();
fragment_1: onCreateView();
fragment_1: onActivityCreated();
fragment_1: onStart();
2. 转入fragment_1
fragment_2: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == true;
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_2: onAttach();
fragment_2: onCreate();
fragment_2: onCreateView();
fragment_2: onActivityCreated();
fragment_2: onStart();
2. 转入fragment_2
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_2: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == true;
fragment_2: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
3. 转入fragment_1
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_2: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == true;
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_0: onAttach();
fragment_0: onCreate();
fragment_0: onCreateView();
fragment_0: onActivityCreated();
fragment_0: onStart();
4. 转入fragment_0
fragment_1: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == true;
fragment_0: setUserVisibleHint (boolean isVisibleToUser) –>isVisibleToUser == false;