I am using Fragment activity in which I am calling data by using recycler adapter. It will display all the data from database. Then, I will move to an activity by clicking on a particular item of recyclerview. In that activity, I have to move to another activity which extends FragmentActivity(android.support.v4.app.FragmentActivity) in which I have a button that is used to display both Date and time in one view by using Dialog Fragment. The app crash when I'm clicking on it and getting the following error.
android.view.InflateException: Binary XML file line #10: Error inflating class fragment
And I need to clarify that is there any problem when call between Fragment to activity and then to FragmentActivity?
Thanks in advance.
Update:
XML Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#fff"
android:weightSum="11">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/toolbar"
android:text="MOVE CAB"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<ImageView
android:id="@+id/cab_image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.5"
android:src="@drawable/cars"
android:padding="30sp"/>
<TextView
android:id="@+id/cab_text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7"
android:gravity="center"
android:text="Prime Seden"
android:textColor="#444"
android:textSize="17sp"/>
<ImageView
android:paddingTop="2sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
/>
<ImageView
android:paddingTop="2sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
android:src="@drawable/picl"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center|left"
android:paddingLeft="20sp"
android:text="Select color"
android:textColor="#999" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:weightSum="2"
android:orientation="horizontal">
<RelativeLayout
android:gravity="center|left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"/>
</RelativeLayout>
<CheckBox
android:layout_marginLeft="20sp"
style="@android:style/Widget.CompoundButton.RadioButton"
android:gravity="center|left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:textColor="#999"
android:theme="@style/RadioButtonStyle"
android:textSize="14sp"
android:id="@+id/radio_ninjas"
android:text="Any color"/>
</LinearLayout>
</LinearLayout>
<ImageView
android:paddingTop="2sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
android:src="@drawable/picl"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:gravity="center|left"
android:paddingLeft="20sp"
android:text="Select no.of seat"
android:textColor="#999"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<Spinner
android:id="@+id/number_spinner"
android:layout_width="0dp"
android:layout_marginLeft="20sp"
android:layout_marginRight="20sp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@android:style/Widget.Holo.Light.Spinner"
/>
</LinearLayout>
<ImageView
android:paddingTop="2sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
android:src="@drawable/picl"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.25"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:gravity="center|left"
android:paddingLeft="20sp"
android:text="Ac / Non Ac"
android:textColor="#999"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<RadioGroup
android:id="@+id/rg1"
android:layout_width="0dp"
android:orientation="vertical"
android:layout_marginLeft="20sp"
android:layout_marginRight="20sp"
android:layout_height="match_parent"
android:layout_weight="1" >
<RadioButton
android:id="@+id/ac_rb"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#999"
android:theme="@style/RadioButtonStyle"
android:checked="true"
android:textSize="14sp"
android:text="Ac"/>
<RadioButton
android:id="@+id/nonac_rb"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#999"
android:theme="@style/RadioButtonStyle"
android:textSize="14sp"
android:text="non-Ac"/></RadioGroup>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.35"/>
<LinearLayout
android:background="#999"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.80"
android:orientation="horizontal"
android:weightSum="1"
>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:text="RIDE NOW"
android:textColor="#f79a06"
android:textSize="15sp"
android:layout_marginRight="0.1dp"
android:id="@+id/ride_start"
android:gravity="center"
android:background="#000"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:text="RIDE LATER"
android:textColor="#f79a06"
android:textSize="15sp"
android:id="@+id/ride_later"
android:layout_marginLeft="0.1dp"
android:gravity="center"
android:background="#000"/></LinearLayout></LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/fare_estimation_ll"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="300sp"
android:background="#fff"
android:orientation="vertical"
android:weightSum="6">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7"
android:text="Fares are higher than normal"
android:textColor="#000"
android:gravity="center"
android:background="#eee"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2"
>
<TextView
android:layout_marginLeft="8sp"
android:layout_marginRight="2sp"
android:background="@drawable/fare_button_border"
android:gravity="center"
android:text="Rs. 149 Micro"
android:layout_width="0dp"
android:textColor="@color/black"
android:layout_height="match_parent"
android:layout_weight="1"/>
<TextView
android:background="@drawable/fare_button_border"
android:layout_marginLeft="8sp"
android:layout_marginRight="8sp"
android:gravity="center"
android:layout_width="0dp"
android:text="Rs. 84 Share your ride"
android:textColor="@color/black"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout>
<View
android:background="@drawable/underline"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"/>
<LinearLayout
android:layout_marginTop="15sp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2"
>
<TextView
android:layout_marginLeft="8sp"
android:layout_marginRight="2sp"
android:paddingLeft="20sp"
android:gravity="center|left"
android:text="Personal"
android:layout_width="0dp"
android:textColor="@color/black"
android:layout_height="match_parent"
android:layout_weight="1"/>
<TextView
android:layout_marginLeft="8sp"
android:layout_marginRight="2sp"
android:paddingLeft="20sp"
android:gravity="center"
android:text="Set up payment"
android:layout_width="0dp"
android:textColor="@color/black"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout>
<View
android:background="@drawable/underline"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"
android:layout_marginBottom="10sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7"
android:textColor="#000"
android:gravity="center|left"
android:paddingLeft="28sp"
android:text="Apply Coupon"/>
<View
android:background="@drawable/underline"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"/>
<Button
android:id="@+id/confirm_booking"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.1"
android:background="#111"
android:gravity="center"
android:textSize="17sp"
android:text="CONFIRM BOOKING"
android:textColor="#f79a06"/>
</LinearLayout>
</FrameLayout>
Stack Trace
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5233)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)