New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IndexOutOfBoundsException: Index: 12, Size: 12 #22
Comments
this keeps happening whenever you click the finish button it throws indexOutOfBoundException:index: yourStepsSize, size: yourStepsSize (if you have 6 steps it tries to access the 6th element of array of size 6 which doesn't exist) |
In my SingleInputFormActivity subclass I have added this override:
It's perfectly harmless to do this check. If you need to save other state then make sure to do it at the start of the method. (Over here I get the same error while Android attempts to save the activity instance state, you might want to consider doing a similar check in you onClick handler) |
Interestingly this doesn't crash my physical device, but emulators and other people I have asked to test my app suffer crashes. I need to implement the fix that you mention, but I need to work out how to include this library in a way that I can edit. I still don't fully understand what I am doing! |
Do you have any idea how to reproduce this bug? Thanks in advance. |
at java.util.ArrayList.get(ArrayList.java:411)
at com.heinrichreimersoftware.singleinputform.SingleInputFormActivity.getStep(SingleInputFormActivity.java:200)
at com.heinrichreimersoftware.singleinputform.SingleInputFormActivity.getCurrentStep(SingleInputFormActivity.java:196)
at com.heinrichreimersoftware.singleinputform.SingleInputFormActivity.nextStep(SingleInputFormActivity.java:408)
at com.heinrichreimersoftware.singleinputform.SingleInputFormActivity$2.onClick(SingleInputFormActivity.java:100)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22433)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6195)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
The text was updated successfully, but these errors were encountered: