GeoQuiz keeps stopping. Open app again


Hi, i’m on chapter 2 of the book android programming 3rd edition. at the time to test the application either on the emulator or the phone i get the message GeoQuiz has stop. The error i get is:

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0

and below is where is pointing to:

          mNextButton = (Button) findViewById(;
    mNextButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            mCurrentIndex = (mCurrentIndex + 1) % mQuestionsBank.length;
            //int question = mQuestionsBank[mCurrentIndex].getTextResId();
    updateQuestion(); <------_this is the first error is pointing_
private void updateQuestion(){
    int question = mQuestionsBank[mCurrentIndex].getTextResId();
    mQuestionTextView.setText(question);  <------_this is the second error is pointing out_

Thanks in advance


The error message is saying the value of question is zero. Is mCurrentIndex a local variable?


Yes. mCurrentIndex is a local variable.