I have 2 fragments, a fragment with a MapFragment and a regular details fragment.
I followed the guide by arshu here : How to put Google Maps V2 on a Fragment Using ViewPager
But when I rotate my screen in the mapFragment in get an error 'Can not perform this action after onSaveInstance'.
This is probaly caused by the onDestroyView method
super.onDestroyView();
if (mMap != null) {
getActivity()
.getSupportFragmentManager()
.beginTransaction()
.remove(getActivity().getSupportFragmentManager()
.findFragmentById(R.id.location_map)).commit();
mMap = null;
}
But if I remove this, I get following error:
Error inflating class fragment at CreateViewFromTag
Full code here: https://github.com/RobbySmet/ITPAppChallenge
How can I fix this or what am I doing wrong?