title: java.lang.IndexOutOfBoundsException: Invalid index 13, size is 13
body: <p>Im getting some weird error which crashing my android app. Its a quiz app. So when user answer 2/3 question correctly then click the next button this it crash. and show index 13 error. But i couldn't figure out where to fix/ look for. here is my code snippet. </p>
  
  <pre><code>public Vector&lt;Sprite&gt; defaultTile;
  
  private void GameResults()
  {
      if(result.equals("right"))      
      {           
          GameOver();
          Log.e("Gaa", "Right Here -&gt;");
      }
  }
  
  private void GameOver() {
  {
      for (int i = 0; i &lt; defaultTile.size(); i++) {
          defaultTile.get(i).setVisible(false);               
      }
      for (int i = 0; i &lt; defaultTile.size(); i++) 
      {
          unregisterTouchArea(defaultTile.get(i));                
      }
      questionText.detachSelf();   
  }   
  
  @Override
  public boolean onAreaTouched(TouchEvent event, ITouchArea area, float posX,
          float posY) {
  
      if(event.isActionUp())
      {
          if(area instanceof Sprite)
          {
              Sprite sprite = (Sprite)area;
              int userData = (Integer) sprite.getUserData();
              switch(userData) 
              {
              case BTN_NEXT:                              
                  if(gameState.equals("alpha") &amp;&amp; tickBg.isVisible())
                  {                       
                      countdown.cancel();                         
                      GameResults();  
                  }           
  
                  break;
              }
          }
      }
  }   
  </code></pre>
  
  <p>Log cat details is like this</p>
  
  <pre><code>08-09 13:30:50.246: W/dalvikvm(919): threadid=12: thread exiting with uncaught exception (group=0x409c01f8)
  08-09 13:30:50.276: E/AndroidRuntime(919): FATAL EXCEPTION: GLThread
  08-09 13:30:50.276: E/AndroidRuntime(919): java.lang.IndexOutOfBoundsException: Invalid index 9, size is 9
  08-09 13:30:50.276: E/AndroidRuntime(919):  at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at java.util.ArrayList.get(ArrayList.java:304)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onManagedDrawChildren(Entity.java:1008)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onDrawChildren(Entity.java:1000)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onManagedDraw(Entity.java:993)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.shape.Shape.onManagedDraw(Shape.java:120)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onDraw(Entity.java:875)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onManagedDrawChildren(Entity.java:1008)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onDrawChildren(Entity.java:1000)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onManagedDraw(Entity.java:993)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.scene.Scene.onManagedDraw(Scene.java:233)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.entity.Entity.onDraw(Entity.java:875)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.engine.Engine.onDrawScene(Engine.java:517)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.engine.Engine.onDrawFrame(Engine.java:509)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.opengl.view.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:154)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.opengl.view.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
  08-09 13:30:50.276: E/AndroidRuntime(919):  at org.anddev.andengine.opengl.view.GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here is my full class file <a href="http://jquery404.com/file/GameScene.txt" rel="nofollow">http://jquery404.com/file/GameScene.txt</a></p>