Solution 1:
override onSaveInstanceState()
and remove the super call in it.
@Override
public void onSaveInstanceState(Bundle outState) {
}
Solution 2:
override onSaveInstanceState()
and remove your fragment before the super call
@Override
public void onSaveInstanceState(Bundle outState) {
// TODO: Add code to remove fragment here
super.onSaveInstanceState(outState);
}