Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9065981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:38:13+00:00 2026-06-16T16:38:13+00:00

I created a little android game but I am getting weird error. Here is

  • 0

I created a little android game but I am getting weird error.

Here is log:

    12-31 16:10:22.407: E/AndroidRuntime(12824): FATAL EXCEPTION: Thread-1461
    12-31 16:10:22.407: E/AndroidRuntime(12824): java.lang.IndexOutOfBoundsException: Invalid index 1, size is 0
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at java.util.ArrayList.get(ArrayList.java:304)
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at **.***.****.GameScreen.updatePaused(GameScreen.java:91)
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at **.***.****.GameScreen.update(GameScreen.java:43)
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at **.***.****.framework.impl.AndroidFastRenderView.run(AndroidFastRenderView.java:39)
    12-31 16:10:22.407: E/AndroidRuntime(12824):    at java.lang.Thread.run(Thread.java:856)

And here is part of code executed :

    int len = touchEvents.size();
    for(int i = 0; i < len; i++) {
        TouchEvent event = touchEvents.get(i); ->>> this line
    .
    .
    .

What is wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:38:14+00:00Added an answer on June 16, 2026 at 4:38 pm

    If you are having threading issues you’ll have to either synchronize on the collection prior to looping like this

    synchronize(touchEvents) {
        for(TouchEvent event : touchEvents) {
            //do whatever you want with events
        }
    }
    

    Or, you can make a local copy of the collection and loop over that, if it’s still valid to process events in the collection if they have been removed while you’re working on the copy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a little script for displaying a calendar but the month is 1
I am currently trying to make a little game for Android. I try to
I am currently working on an android project and have created a little test
I'm getting a little bit crazy with this issue. I created an amount of
Well!! My question is little weird .. I have created an chat channel which
I'm developing a little Game at the Moment (Android-App) and I want to save
I'm writing my little app for Android. I'm trying to create files. Here is
I get following error message in my little android application: SQLiteException: table depot has
I created a map view in my app and I'm getting this error: 09-07
I have a little problem. I have created an android api that uses google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.