I’m having trouble figuring out the issue with me textview. When I run the app it is initially blank until I hit the next or prev button to move to the next question.
You should have a call to the private updateQuestion()
method or its statements in your onCreate()
method:
int question = mQuestionBank[mCurrentIndex].getTextResId();
mQuestionTextView.setText(question);
If this is the case and it still doesn’t work you should print out the value of question
and verify that it’s not 0. Also, verify that your strings.xml
contains more than whitespace in the respective <string>
element.
Thanks, that was it. I was missing the call to updateQuesion in onCreate().