문제

So, I need some code to be executed only once when FragmentActivity is created. I was method thining that protected void onCreate(Bundle savedInstanceState) is only called first time when FragmentActivity comes to flow. But, then from that FragmentActivity I go into another and after coming back from that second one, onCreate gets called again. I was looking on FragmentActivity cycle and that's not clear for me. Is there method that only gets invoked at very beginning and not after coming back on that activity any more?

도움이 되었습니까?

해결책

Could you verify that FragmentActivity.onDestroy is not called? If it does get called, maybe the second paragraph of the of the Activity lifecycle could help you understand what's going on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top