当前位置: 代码迷 >> Android >> 怎么解决: E/AndroidRuntime(1459): java.lang.ArrayIndexOutOfBoundsExcep
  详细解决方案

怎么解决: E/AndroidRuntime(1459): java.lang.ArrayIndexOutOfBoundsExcep

热度:230   发布时间:2016-05-01 21:06:47.0
如何解决: E/AndroidRuntime(1459): java.lang.ArrayIndexOutOfBoundsExcep
大家帮忙看下怎么解决:06-01 07:18:13.679: D/szipinf(1459): Initializing inflate state
06-01 07:18:13.698: D/szipinf(1459): Initializing zlib to inflate
06-01 07:18:20.117: D/AndroidRuntime(1459): Shutting down VM
06-01 07:18:20.117: W/dalvikvm(1459): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-01 07:18:20.148: E/AndroidRuntime(1459): FATAL EXCEPTION: main
06-01 07:18:20.148: E/AndroidRuntime(1459): java.lang.ArrayIndexOutOfBoundsException
06-01 07:18:20.148: E/AndroidRuntime(1459): at java.util.ArrayList.get(ArrayList.java:313)
06-01 07:18:20.148: E/AndroidRuntime(1459): at com.amaker.test.Sequence_Display$5.onClick(Sequence_Display.java:93)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.view.View.performClick(View.java:2485)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.view.View$PerformClick.run(View.java:9080)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.os.Handler.handleCallback(Handler.java:587)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.os.Handler.dispatchMessage(Handler.java:92)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.os.Looper.loop(Looper.java:123)
06-01 07:18:20.148: E/AndroidRuntime(1459): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-01 07:18:20.148: E/AndroidRuntime(1459): at java.lang.reflect.Method.invokeNative(Native Method)
06-01 07:18:20.148: E/AndroidRuntime(1459): at java.lang.reflect.Method.invoke(Method.java:507)
06-01 07:18:20.148: E/AndroidRuntime(1459): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-01 07:18:20.148: E/AndroidRuntime(1459): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-01 07:18:20.148: E/AndroidRuntime(1459): at dalvik.system.NativeStart.main(Native Method)


------解决方案--------------------
在tv01.setText( englishes.get(m).getWord()+"\r\n");
这句前面加一段
if(m>=0 && m<englishes.size())

 
  相关解决方案