I have an Activity "A" which contains a view pager that contains 5 fragments. One of the fragment has over 7-8 fragments added programmatically. Each fragment is instantiated using the static method instance() defined in the respective fragment.
for(int i = 0 ; i < 10; i++) {
CustomFragment fragment = (CustomFragment) Class.forName(classNameList.get(i)).instance();
getFragmentManager().beginTransaction().add(R.id.parentLinearLayout, fragment, fragmentTag).commitAllowingStateLoss();
}
Everything works fine when this activity is launched and traversed across different fragments.
But if I launch an activity "B" and return to activity "A". All the other fragments in the view pager load fine except the fragment that contains the set of fragments. It shows up as a blank screen. What could be the problem?