My program displays an array of questions (question one-by-one). After I write an answer, an alert message should tell me whether my answer is right or wrong. The problem is that, even if I write the right answer the alert message displays a "false" message.
final String questions[] = {"Who's Tom?", "Who's Luca?", "Who's Flavie?"}
final String answers[] = {"American", "Italian", "French"}
// display question
answer_question.setOnClickListener(new View.OnClickListener() {
int CurrentQuestionIndex = 0;
public void onClick(View v) {
ask_question.setText(question[(CurrentQuestionIndex++) % (questions.length)]);
// discuss question versus answer
EditText answer = (EditText) findViewById(R.id.tvReponseF);
if (answer.equals(answers[CurrentQuestionIndex])) {
alertMessageRight();
} else {
alertMessageFalse();
}
}
});
answersarray.