Hello, im trying to get the answers from the secound array but it takes just the last question and answer hers is the code:
search.setOnClickListener(new View.OnClickListener() {
String[] questions = {
"http",
"arp",
"asd"
};
String[] answers = {
"HyperText Transfer Protocol",
"Advanced Research Project",
"asdasdasdasdasdasdasdasd."
};
@Override
public void onClick(View v) {
String word1 = word.getText().toString();
for (int i = 0; i < questions.length; i++) {
for (int j = 0; j < answers.length; j++) {
if(word1.equals(questions[i])){
description.setText(answers[j]);
} else {
description.setText("We doesn't find that word");
}
}
}
}
});
why this doesnt work and what should i fix ?