Discussion Forums  >  Uncategorized

Replies: 9    Views: 244

bladeboy
Android Fan
Profile
Posts: 34
Reg: Apr 24, 2011
Sheffield, Engl...
340
07/18/11 02:13 AM (14 years ago)

Crash errors in quiz for Android 1.4

Had some issues with quiz questions in Android 1.4. Certain questions seem to cause an application error - it's not random or when you reach a certain number of points or anything as I've tested it and it's always the same questions. But obviously as far as I know I did nothing different for those questions when I input them as any of the others. Any suggestions?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/18/11 03:37 AM (14 years ago)
Weird for sure. I have heard of some problems with some funky characters in the text. Like apostrophe's, quotes, etc. Maybe check to make sure something like that isn't crashing it. v1.4 doesn't handle non alpha-numeric character data very well so this could be the trouble?
 
bladeboy
Android Fan
Profile
Posts: 34
Reg: Apr 24, 2011
Sheffield, Engl...
340
like
07/18/11 03:43 AM (14 years ago)
This is the error report from the handset: java.lang.IndexOutOfBoundsException: Invalid index 10, size is 10 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) at java.util.ArrayList.get(ArrayList.java:311) at com.v1_4.BF1386E5B496FBF8601C185B.com.Screen_QuizMultipleChoice.answerClick(Screen_QuizMultipleChoice.java:312) at com.v1_4.BF1386E5B496FBF8601C185B.com.Screen_QuizMultipleChoice$8.onClick(Screen_QuizMultipleChoice.java:160) at android.view.View.performClick(View.java:2408) at android.view.View$PerformClick.run(View.java:8817) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:144) at android.app.ActivityThread.main(ActivityThread.java:4937) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/18/11 03:47 AM (14 years ago)
Ah... not related to the question itself but instead related to the NUMBER of the question. I'm guessing here. It looks like maybe the last question or something is causing the trouble? Not sure why? The indexOutOfBound message is a good hint. Example: If the quiz has ten questions and the app tries to load the 11th one it will be 'out of bound' Not sure why this is happening but I'll be that's the trouble. See if you can isolate what the number of the quesiton is compared to how many there are or something?
 
bladeboy
Android Fan
Profile
Posts: 34
Reg: Apr 24, 2011
Sheffield, Engl...
340
like
07/18/11 04:55 AM (14 years ago)
Hmm - the issue was that it was always the same question that triggered it (well two of them) - I've deleted them and it seem to work fine now. The problem is I'm loath to add in any more in case it happens again and it's difficult to test as you can't run individual questions...
 
fusionmtx
Android Fan
Profile
Posts: 178
Reg: Jun 15, 2011
Orlando
2,180
like
07/24/11 02:07 PM (14 years ago)
Im having the same issue at least I think. java.lang.IndexOutOfBoundsException: Invalid index 10, size is 10 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) at java.util.ArrayList.get(ArrayList.java:311) at com.v1_4.B60E6D01565D444A597A8FCB.com.Screen_QuizMultipleChoice.answerClick(Screen_QuizMultipleChoice.java:312) at com.v1_4.B60E6D01565D444A597A8FCB.com.Screen_QuizMultipleChoice$8.onClick(Screen_QuizMultipleChoice.java:160) at android.view.View.performClick(View.java:2461) at android.view.View$PerformClick.run(View.java:8888) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at dalvik.system.NativeStart.main(Native Method)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/24/11 11:46 PM (14 years ago)
It's tricky figuring this out for sure. I think the issue is the number of questions in the array of questions and the number of questions set in the control panel. Maybe try setting the number of questions in the control panel to a few less than the total number so the code never does the 'out of range' thing.
 
fusionmtx
Android Fan
Profile
Posts: 178
Reg: Jun 15, 2011
Orlando
2,180
like
07/24/11 11:47 PM (14 years ago)
I have over 80 questions lol
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/25/11 12:27 AM (14 years ago)
So what happens when you set the quiz length to like 5 for testing? The idea is to see if it crashes when you use less questions than the size of the question bank. If it doesn't crash at 5 I'll bet it wont' at 75 and will at 80. In other words, use a few less than the total number. Do you really ask folks to take a quiz with 80 questions? Seems like multiple quizzes would be better? Not sure of the design, just seems like it ;-)
 
fusionmtx
Android Fan
Profile
Posts: 178
Reg: Jun 15, 2011
Orlando
2,180
like
07/25/11 07:12 AM (14 years ago)
I use the quiz for trivia that's why I have so many questions and what not. Do u know if there O's a fix possible for this?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.