我的Play-Console中有一個奇怪的StackTrace - 我無法重現該問題,它不直接在我的代碼中產生。也許這裏有人有一個關於如何處理這個問題的想法,而不是忽略它。雖然發生過一次 - 但我真的很想知道那裏發生了什麼。ListPreference中的ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
at android.preference.ListPreference.getEntry(ListPreference.java:203)
at android.preference.ListPreference.getSummary(ListPreference.java:148)
at android.preference.Preference.onBindView(Preference.java:522)
at android.preference.Preference.getView(Preference.java:460)
at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:221)
at android.widget.AbsListView.obtainView(AbsListView.java:2308)
at android.widget.ListView.makeAndAddView(ListView.java:2030)
at android.widget.ListView.fillDown(ListView.java:822)
at android.widget.ListView.fillFromTop(ListView.java:883)
at android.widget.ListView.layoutChildren(ListView.java:1848)
at android.widget.AbsListView.onLayout(AbsListView.java:2136)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1663)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1521)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1663)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1652)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1436)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1663)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1521)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1663)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1521)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14177)
at android.view.ViewGroup.layout(ViewGroup.java:4399)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2244)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2017)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1190)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4860)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:766)
at android.view.Choreographer.doCallbacks(Choreographer.java:575)
at android.view.Choreographer.doFrame(Choreographer.java:542)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:751)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:5751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
at dalvik.system.NativeStart.main(Native Method)
請檢查您在ListPref中使用的ArrayList的大小是否有錯誤...? –
@ligi你是否也可以發佈用於設置列表的偏好設置的XML? – JJD
我也只在某個設備上面對同樣模糊的異常 - 在所有其他設備上它工作正常。將不勝感激帖子的進展。 – SirKnigget