ViewPager를 호스팅하는 mainActivity가 있으며 세 개의 탭 (MQTT, ECO, Logger)이 있습니다. mainActivity에는 lifecycles 콜백 (onCreat, onResume)이 있고 다른 세 개의 탭에는 ' lifeCycle 콜백 (onattached, onCreateView, onViewcreated, onResume, onPause)이 있습니다.프래그먼트의 lifeCycle에 관한 혼동
실행 시간에, 나는 다음과 같은 로그 캣에 나타납니다
01-29 13:28:28.732: W/MainActivity(31412): @onCreate().
01-29 13:28:28.802: W/MainActivity(31412): @onResume().
01-29 13:28:28.842: W/MQTT_Settings_Frag(31412): @onAttach().
01-29 13:28:28.842: W/MQTT_Settings_Frag(31412): @onCreateView().
01-29 13:28:28.862: W/MQTT_Settings_Frag(31412): @onViewCreated().
01-29 13:28:28.862: W/MQTT_Settings_Frag(31412): @onResume().
01-29 13:28:28.862: W/Eco_Settings_Frag(31412): @onAttach().
01-29 13:28:28.862: W/Eco_Settings_Frag(31412): @onCreateView().
01-29 13:28:28.892: W/Eco_Settings_Frag(31412): @onViewCreated().
01-29 13:28:28.892: W/Eco_Settings_Frag(31412): @onResume().
을하고 난 에코 탭 "두 번째"로 이동 슬쩍 때, logCa는 조각 접 아무것도보고하지,하지만 난 슬쩍 때 구현 미처 로그 캣 표시하고있다 - 어떤 세 번째 탭 '로거'로 :
: 내가 다시 에코 탭을 로거 탭에서 아래로 스 와이프하면01-29 13:37:27.062: W/MQTT_Settings_Frag(31412): @onPause().
하고, 로그 캣은 다음 dispays에
01-29 13:37:52.292: W/MQTT_Settings_Frag(31412): @onCreateView().
01-29 13:37:52.322: W/MQTT_Settings_Frag(31412): @onViewCreated().
01-29 13:37:52.322: W/MQTT_Settings_Frag(31412): @onResume().
why the first tab "MQTT-Tab" goes in onPause() when i goto only to the third Tab Logger-Tab?
And why the first tab "MQTT-Tab" goes into (onCreateView, onViewCreated, onResume) when i move to the secondtab Eco-tab frm the third one LoggerTab?
인접한 탭이 뷰 페이지가 호스팅하는 세 개의 탭을 의미합니까? – user2121
인접 항목이란 현재 선택/표시되는 항목과 그 전후의 항목을 의미합니다. 이 경우에는 항상 현재보기가 고려됩니다. –