Reputation: 73
Please Help, i'm having some issue with my pref_general.xml file whene i'm luanching the SettingsActivity ( PreferenceActivity ) as the app spotted and i get the following error message:
android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox
Then the logcat points the line in my PreferenceActivity where I call "addPreferencesFromResource(R.xml.pref_general);"
After several hours of trying to sort it out I still have no idea what the issue is so maybe someone is familiar with this or simply another set of eyes can find the problem.
Also, i'm trying this in Android 5.1 everyting is fine, but in Android Api 19 ( in my phone ) nothing working ?
android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox
at android.view.LayoutInflater.createView(LayoutInflater.java:627)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:676)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:701)
at android.view.LayoutInflater.inflate(LayoutInflater.java:470)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at android.preference.Preference.onCreateView(Preference.java:531)
at android.preference.Preference.getView(Preference.java:494)
at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:222)
at android.widget.AbsListView.obtainView(AbsListView.java:2351)
at android.widget.ListView.makeAndAddView(ListView.java:1816)
at android.widget.ListView.fillDown(ListView.java:697)
at android.widget.ListView.fillFromTop(ListView.java:763)
at android.widget.ListView.layoutChildren(ListView.java:1646)
at android.widget.AbsListView.onLayout(AbsListView.java:2207)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1677)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1445)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15033)
at android.view.ViewGroup.layout(ViewGroup.java:4799)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2143)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5998)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1280)
at com.android.int
Thanks all =D
Upvotes: 3
Views: 2744
Reputation: 11903
There is a bug in version 23.2.0
of the support library that can cause this.
This was fixed in revision 23.2.1
of the library. This revision states the following which I believe was the root cause of the issue and explains why it only failed on your phone running API 19:
Fixed an exception in DrawableCompat.wrap() and LayerDrawable on API levels 17 to 19.
Upvotes: 8