Using the latest Android Studio with a project with Fragments. All is well until rotating the screen with a fragment up. Get the error
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xx/com.xxx.xxx.MainActivity}:
android.view.InflateException: Binary XML file line #7: Error inflating class fragment
The xml for the main activity looks like this
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/fragment"
android:name="com.xxx.xxx.MainActivityFragment"
tools:layout="@layout/fragment_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
Line 7 is the fragment definition as provided from Android Studio project create. I have done some searching on this and have not found the reason why the inflator is having a problem on rotation when recreating the fragment.
Otherwise without rotation all seems to be working fine.