1
I made a chatbot/virtual assistant and I want it to answer the same thing for different words, example: if I write "Hi" or write "Hello" it return the same answer: "Hello, how can I help".
public void assistente(View view) {
if (caixa.getText().toString().equals(cumprimento) {
resposta.setText("Olá, como posso te ajudar?");
rosto.setImageResource(R.drawable.normal);
}
resposta.setText("Olá, como posso te ajudar?");
}
String cumprimento = "Olá"; //Nessa parte eu quero colocar outros valores
I use Android Studio 3.0.1. I am very beginner in programming, please explain in the easiest way possible. Thank you very much!
Your question is not clear enough ? Just have that question and answer ? How would it work if the person wrote something else?
– Isac