xxv/android-lifecycle

Explanation about when does onActivityCreated method not called

lujop opened this issue · 1 comments

lujop commented

Can you explain what is fragment restart and why onActivityCreated is not called in it?
I've tried with latest v4 support version 23.3.0 and I can't reproduce the case where onActivityCreated isn't called.

Here is some discussion about that:
http://stackoverflow.com/questions/36858835/onactivitycreated-is-always-called/36858971?noredirect=1#comment61291313_36858971

My guess is that in some rare cases, the fragment called onDestroyView() but the activity is not yet destroyed. When frag is resumed, the fragment still attached to activity hence no need to call on ActivityCreated()

But that's just my guess. Need more reference to prove that.