IndexOutOfBounds when navigating to Form

19 views
Skip to first unread message

Dante vd merwe

unread,
Jun 19, 2015, 10:16:55 AM6/19/15
to codenameone...@googlegroups.com
Hi, 

I get this error which is very hard to reproduce. We have experienced this on multiple devices. This happens when I navigate to a form with a container, which has a grid layout with 2 components on them. It happens at random... And I do not make use of any arrays in the form.

Here is a dump from the logs:
W/System.err( 7433): java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2

W/System.err( 7433):    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)

W/System.err( 7433):    at java.util.ArrayList.get(ArrayList.java:308)

W/System.err( 7433):    at com.codename1.k.e.a(Container.java:978)

W/System.err( 7433):    at com.codename1.k.d.b(Component.java:1266)

W/System.err( 7433):    at com.codename1.k.d.d(Component.java:1240)

W/System.err( 7433):    at com.codename1.k.d.a(Component.java:1215)

W/System.err( 7433):    at com.codename1.k.e.a(Container.java:979)

W/System.err( 7433):    at com.codename1.k.k.a(Form.java:2847)

W/System.err( 7433):    at com.codename1.k.d.b(Component.java:1266)

W/System.err( 7433):    at com.codename1.k.k.b(Form.java:2857)

W/System.err( 7433):    at com.codename1.k.d.d(Component.java:1240)

W/System.err( 7433):    at com.codename1.k.d.a(Component.java:1215)

W/System.err( 7433):    at com.codename1.k.d.c(Component.java:1183)

W/System.err( 7433):    at com.codename1.k.d.c(Component.java:1461)

W/System.err( 7433):    at com.codename1.k.d.h(Component.java:1412)

W/System.err( 7433):    at com.codename1.impl.a.o(CodenameOneImplementation.java:489)

W/System.err( 7433):    at com.codename1.k.h.j(Display.java:1064)

W/System.err( 7433):    at com.codename1.k.h.i(Display.java:991)

W/System.err( 7433):    at com.codename1.k.u.run(RunnableWrapper.java:120)

W/System.err( 7433):    at com.codename1.impl.b$1.run(CodenameOneThread.java:60)

W/System.err( 7433):    at java.lang.Thread.run(Thread.java:841)




Shai Almog

unread,
Jun 19, 2015, 12:40:51 PM6/19/15
to codenameone...@googlegroups.com, dante...@gmail.com
Hi,
this seems to be triggered by modifying the Container while an animation is in progress.

Dante vd merwe

unread,
Jun 22, 2015, 5:21:15 AM6/22/15
to codenameone...@googlegroups.com, dante...@gmail.com
Do you maybe have a suggestions on how I can call my display functions? So that this would not occur...

Thanks for all the support so far!

Shai Almog

unread,
Jun 22, 2015, 9:45:35 AM6/22/15
to codenameone...@googlegroups.com, dante...@gmail.com
Do you have an animation going on there?
E.g. layout animation?
If so create a lock flag and prevent other modifications to the UI while the animation is running.

Dante vd merwe

unread,
Jun 23, 2015, 7:22:53 AM6/23/15
to codenameone...@googlegroups.com, dante...@gmail.com
Thanks a lot Shai, 

I tried to do UI stuff outside the EDT, but its fixed now.

Spent a good amount of time reading the developers guide yesterday.
Reply all
Reply to author
Forward
0 new messages