Dave's Brain

Browse - Programming Tips - ArrayOutOfBoundsException at android.preference.ListPreference.onDialogClosed(ListPreference.java:280) ?

Date: 2017mar16
OS: Android

Q.  ArrayOutOfBoundsException at android.preference.ListPreference.onDialogClosed(ListPreference.java:280) ?

Why I am getting a crash of:

java.lang.ArrayIndexOutOfBoundsException: length=12; index=12 at android.preference.ListPreference.onDialogClosed(ListPreference.java:280) at android.preference.DialogPreference.onDismiss(DialogPreference.java:391) at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1278) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5651) 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:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
A. This is probably because your item list is not exactly the same length as the value list (in strings.xml)

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.