I have an Activity in which I have few fragments.
Fragments are all set to false for retain instance property which means that they are destroyed when screen oritenation changes. (Plus, they are not in back stack)
When I change the screen orientation, I observed that fragments are destroyed and recreated which is expected.
What I don't expect is - re-attaching those fragments by the activity during activity re-creation. I have a null check inside Activity's onCreate method which determines if fragment is exists or not and according to this decision it's added or attached.
Now, if all fragments are deleted/destroyed, how fragment is attached in onCreate of activity. Shouldn't be added since it's destroyed?
I suspect that super.onCreate(savedInstanceState) of Activity's onCreate loads the fragment again here.
Any ideas?