title: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
body: <p>Some users are getting this crash too frequently in my app developed in andengine. 
  I am not detaching/attaching any objects but still I am getting this error. I am using object visibility and unregistertoucharea though which I didn't put into runonupdate. Can that cause this issue. If not can someone please tell me what might? </p>
  
  <p>This is the crash report I am getting from Google Play.</p>
  
  <pre><code>java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
  at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
  at java.util.ArrayList.get(ArrayList.java:308)
  at org.andengine.c.a.d(Unknown Source)
  at org.andengine.c.c.e.d(Unknown Source)
  at org.andengine.c.a.a(Unknown Source)
  at org.andengine.b.a.b(Unknown Source)
  at org.andengine.b.a.a(Unknown Source)
  at org.andengine.opengl.e.g.onDrawFrame(Unknown Source)
  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
  </code></pre>
  
  <p>Sometime the game is crashing on gameover and sometime is crashing on restarting the game </p>
  
  <p>When the game is over I am calling the following function </p>
  
  <pre><code>public void GameOver(){
      yourScoreText.setText(""+score);        
      restart_button.setVisible(true);
      leaderboard_button.setVisible(true);
      share_button.setVisible(true);
      gameOverText.setVisible(true);
      gameOverOverlay.setVisible(true);
      yourScoreText.setVisible(true);
      highScoreText.setVisible(true);
  
      this.registerTouchArea(restart_button);
      this.registerTouchArea(leaderboard_button);
      this.registerTouchArea(share_button);
  }
  </code></pre>
  
  <p>When the restart is pressed I am calling the following function. </p>
  
  <pre><code>public void RestartGame(){
      restart_button.setVisible(false);
      leaderboard_button.setVisible(false);
      share_button.setVisible(false);
      gameOverText.setVisible(false);
      gameOverOverlay.setVisible(false);
      yourScoreText.setVisible(false);
      highScoreText.setVisible(false);
      this.unregisterTouchArea(restart_button);
      this.unregisterTouchArea(leaderboard_button);
      this.unregisterTouchArea(share_button);
      score = 0;
      scoreText.setText("Score: "+score);
  
      Log.d("game start","game has been started");
      StartScreen();
  }
  public void StartScreen(){
      leaderboard_home_button.setVisible(true);
      rate_button.setVisible(true);
      if(activity.getNoAds()==0){
          no_ads_button.setVisible(true);
          this.registerTouchArea(no_ads_button);
      }
      if(isMute){
          sound_off_button.setVisible(true);
          this.registerTouchArea(sound_off_button);
      } else {
          sound_on_button.setVisible(true);
          this.registerTouchArea(sound_on_button);
      }
      this.registerTouchArea(leaderboard_home_button);
      this.registerTouchArea(rate_button);
  
  }
  </code></pre>