I believe you're getting ResourceNotFoundException
,
Please note this array of your QuizActivity
private TrueFalse[] mQuestionBank = new TrueFalse [] {
new TrueFalse(R.string.question_oceans, true),
new TrueFalse(R.string.question_mideast, false),
new TrueFalse(R.string.question_africa, false),
new TrueFalse(R.string.question_americas, true),
new TrueFalse(R.string.question_asia, true),
};
The cause starts here,
private int mQuestion; // Default Value of this integer is 0
public TrueFalse(int question, boolean trueQuestion) {
mQuestion = getQuestion(); // You're just assigning assigning the value of mQuestion to itself
mTrueQuestion = trueQuestion;
}
question
parameter is never been passed to field mQuestion
.
To fix, you must assign question
to mQuestion
variable.
public TrueFalse(int question, boolean trueQuestion) {
mQuestion = question;
mTrueQuestion = trueQuestion;
}