Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top