我不知道问题是否出在Android Studio 2.0上,但现在我无法打开共享首选项。这是我单击菜单按钮并且应用程序崩溃后它返回的错误:
04-21 16:46:12.412 10969-10969/com.example.sdilab.dica E/login activity: File not found: java.io.FileNotFoundException: /data/data/com.example.sdilab.dica/files/language: open failed: ENOENT (No such file or directory)
04-21 16:46:12.822 10969-10969/com.example.sdilab.dica E/login activity: File not found: java.io.FileNotFoundException: /data/data/com.example.sdilab.dica/files/language: open failed: ENOENT (No such file or directory)
04-21 16:46:12.997 10969-11086/com.example.sdilab.dica E/NativeCrypto: ssl=0x5a8c17a0 cert_verify_callback x509_store_ctx=0x5f439a40 arg=0x0
04-21 16:46:12.997 10969-11086/com.example.sdilab.dica E/NativeCrypto: ssl=0x5a8c17a0 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
04-21 16:47:10.379 10969-10969/com.example.sdilab.dica E/AndroidRuntime: FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.preference.Preference.onCreateView(Preference.java:487)
at android.preference.Preference.getView(Preference.java:458)
at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:221)
at android.widget.AbsListView.obtainView(AbsListView.java:2237)
at android.widget.ListView.makeAndAddView(ListView.java:1851)
at android.widget.ListView.fillDown(ListView.java:678)
at android.widget.ListView.fillFromTop(ListView.java:739)
at android.widget.ListView.layoutChildren(ListView.java:1664)
at android.widget.AbsListView.onLayout(AbsListView.java:2055)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1893)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1751)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1664)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1893)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1882)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1666)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1893)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1751)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1664)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.FrameLayout.onLayout(FrameLayout.java:507)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1893)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1751)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1664)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.widget.FrameLayout.onLayout(FrameLayout.java:507)
at android.view.View.layout(View.java:14366)
at android.view.ViewGroup.layout(ViewGroup.java:4615)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2286)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2050)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1218)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5057)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
at android.view.Choreographer.doCallbacks(Choreographer.java:579)
at android.view.Choreographer.doFrame(Choreographer.java:548)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
at android.os.Handler.handleCallback(Handler.java:800)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5468)
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:936)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constru
既然它没有显示问题出在我的代码上,那会是什么?
这与共享首选项无关,您的一个 xml 文件存在问题,如堆栈跟踪所示:
android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox