After I updated my Android app yesterday, I'm getting this strange error only from some Samsung Galaxy Note II. I have some Note II devices and I couldn't replicate the issue on my own.
(Line 97 is the line that starts with the tag)
I am sure my class is extending the v4.fragment and FragmentActivity because it works on every devices I have tested it on. But I still get these crash reports and I have no idea how to go about fixing the issues.
Any ideas?
Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zyz.mobile/com.zyz.mobile.jade.JadeActivity}: android.view.InflateException: Binary XML file line #97: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
at android.app.ActivityThread.access$700(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #97: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
at android.app.Activity.setContentView(Activity.java:1956)
at com.zyz.mobile.jade.JadeActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5372)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
... 11 more
Caused by: java.lang.NullPointerException
at com.zyz.mobile.jade.BookshelfFragment.a(Unknown Source)
at android.support.v4.app.p.a(Unknown Source)
at android.support.v4.app.p.b(Unknown Source)
at android.support.v4.app.p.a(Unknown Source)
at android.support.v4.app.h.onCreateView(Unknown Source)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
... 21 more
The XML
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="20dp"
>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_help"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/help"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_option"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/option"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
<com.zyz.mobile.widget.MyButton
android:id="@+id/bookshelf_open"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@drawable/jade_button"
android:textColor="@color/white"
android:text="@string/open_book"
android:textSize="20sp"
android:layout_margin="1dp"
android:gravity="bottom|left"
/>
</LinearLayout>
<com.zyz.mobile.widget.MyTextView
android:id="@+id/history_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/history_title"
android:textColor="@color/black"
android:textSize="20sp"
android:background="@color/grey"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
/>
<fragment
class="com.zyz.mobile.jade.BookshelfFragment"
android:id="@+id/bookshelf_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>