I am having a problem with Fragments
and orientation change.
I have an application which has a MainActivity
which handles the switching up
I had more or less the same problem, but the solutions presented above did not seem to work out in my situation. Eventually I found the following solution:
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
if (mFragment == null) {
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.replace(android.R.id.content, mFragment, mTag); // Use replace iso add
}
else {
ft.attach(mFragment);
}
}