Now, I am developing one JSON project. All JSON values are stored in sqlLite database and the list view is displayed. Some values displayed it correctly and at that moment where the error is shown here below. Please help me.
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): FATAL EXCEPTION: main
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
1开发者_JAVA百科2-08 19:00:27.818: ERROR/AndroidRuntime(1042): at java.util.ArrayList.get(ArrayList.java:311)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at ez.com.Action_module_screen.database(Action_module_screen.java:2443)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at ez.com.Action_module_screen$2.handleMessage(Action_module_screen.java:623)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at android.os.Handler.dispatchMessage(Handler.java:99)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at android.os.Looper.loop(Looper.java:123)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at java.lang.reflect.Method.invokeNative(Native Method)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at java.lang.reflect.Method.invoke(Method.java:521)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-08 19:00:27.818: ERROR/AndroidRuntime(1042): at dalvik.system.NativeStart.main(Native Method)
You're accessing myList.get(0)
for an empty list.
The list might not be called myList
(it probably isn't!) and the call might be get(x)
, for instance, but that is what is happening.
Is Action_module_screen
your own code? That's what's causing the error.
精彩评论