I have a very simple code where I use Action Bar with tab fragments. It works fine after load, but after orientation change it goes crazy. The old fragment also visible (why
public void onTabSelected(Tab tab, FragmentTransaction ft)
{
// Check if the fragment is already initialized
if (mFragment == null)
{
if(ft.findFragmentById(android.R.id.content) == null){
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.add(android.R.id.content, mFragment, mTag);
}
} else
{
// If it exists, simply attach it in order to show it
ft.attach(mFragment);
}
}
Something like that, because your problem is that your adding the same fragment twice, we just have to find where...