My app has a fragment in which inside, it has another fragment of the google map, it works perfect. When turning the device from vertical to horizontal the first time, nothing happens, the application continues to work, but if at the same time I return and turn it I get an error, in the logcat it shows me the following.
android.view.InflateException: Binary XML file line #28: Error inflating class fragment
Obviously it leaves the application, but I have no idea why this happens.
The fragment I'm using for the map is this.
<fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.com.mayorgafirm.saxtant.activity.MapsFragment" />
and I'm initializing it on the OnCreateView like this:
googleMap = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map)); googleMap.onCreate(savedInstanceState);
How can I solve this?
Thank you in advance.