title: Updating arrayIndex onClick of button is causing problem
body: <p>I am implementing a quiz and here am having a method for my button as</p>
  
  <pre><code>public  void playquiz(final int arrayIndex) {
  
  setContentView(R.layout.quiz);
  
  next = (Button) findViewById(R.id.nextBtn);
  
  next.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
              if (arrayIndex == TourDescription.currentTour.getTriviaArray().size()) {
  
                      int totalpoints = correctAnswerCount*10;
                      Intent scoreintent = new Intent(TriviaQuiz.this,ScoreBoard.class);
                      startActivity(scoreintent);
              }   
              else
              {
                     playquiz(arrayIndex+1);
              }
  
  }
  </code></pre>
  
  <p>What I am trying to do is, inside the method I am loading another layout and assigning an onclick for the button in that layout. </p>
  
  <p>Now my problem is, the arrayIndex which I get initially, I have to update this on click of the next button and based on this I have some other conditions to check. </p>
  
  <p>But if I do like playquiz(arrayIndex+1);, it asks me to declare the arrayIndex as final, why is this?</p>
  
  <p>And even then it is not behaving in the exact way as it supposed to be.</p>
  
  <p>The if (arrayIndex == TourDescription.currentTour.getTriviaArray().size()) inside onClick is not happening</p>
  
  <p>Any suggestion?</p>