Discussion Forums  >  Uncategorized

Replies: 2    Views: 400

Piotr
Veteran developer
Profile
Posts: 21
Reg: May 14, 2011
Reading, UK
210
05/30/11 11:38 AM (14 years ago)

buzztouch 1.4: Quiz crashes on Android after uses is right 10 times in a row

Hi, I've just found a problem in buzztouch 1.4 Quiz on Android. After answering 10 consecutive questions right there is a crash. Here is a stack trace: D/AndroidRuntime(22541): Shutting down VM W/dalvikvm(22541): threadid=1: thread exiting with uncaught exception (group=0x40025a70) E/AndroidRuntime(22541): FATAL EXCEPTION: main E/AndroidRuntime(22541): java.lang.IndexOutOfBoundsException: Invalid index 10, size is 10 E/AndroidRuntime(22541): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) E/AndroidRuntime(22541): at java.util.ArrayList.get(ArrayList.java:311) E/AndroidRuntime(22541): at com.v1_4.BFC44D4AAD2E9D5CA502A230.com.Screen_QuizMultipleChoice.answerClick(Screen_QuizMultipleChoice.java:311) E/AndroidRuntime(22541): at com.v1_4.BFC44D4AAD2E9D5CA502A230.com.Screen_QuizMultipleChoice$11.onClick(Screen_QuizMultipleChoice.java:175) E/AndroidRuntime(22541): at android.view.View.performClick(View.java:2421) E/AndroidRuntime(22541): at android.view.View$PerformClick.run(View.java:8869) E/AndroidRuntime(22541): at android.os.Handler.handleCallback(Handler.java:587) E/AndroidRuntime(22541): at android.os.Handler.dispatchMessage(Handler.java:92) E/AndroidRuntime(22541): at android.os.Looper.loop(Looper.java:143) E/AndroidRuntime(22541): at android.app.ActivityThread.main(ActivityThread.java:5068) E/AndroidRuntime(22541): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(22541): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(22541): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) E/AndroidRuntime(22541): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) E/AndroidRuntime(22541): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 1297): Force finishing activity com.v1_4.BFC44D4AAD2E9D5CA502A230.com/.Screen_QuizMultipleChoice I managed to fix the bug. What I did: In Screen_MultipleChoiceQuiz.java after the line: tmpImg = BitmapFactory.decodeResource(getResources(),R.drawable.quiz_9x); bonusImages.add(tmpImg); I added: tmpImg = BitmapFactory.decodeResource(getResources(),R.drawable.quiz_10x); bonusImages.add(tmpImg); and after the lines //counts.. numberRight = (numberRight + 1); numberStreak = (numberStreak + 1); I added: if (numberStreak > 10) numberStreak = 10; I'm posting it here just in case it would help others... Cheers, Piotr
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/30/11 01:00 PM (14 years ago)
Great find! We'll update the download server so others can benefit from your discovery.
 
Piotr
Veteran developer
Profile
Posts: 21
Reg: May 14, 2011
Reading, UK
210
like
05/30/11 01:18 PM (14 years ago)
Excellent! Thanks
 

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.