I am new to programming and would like to know how to do if in android studio a textview
says Dog I get the image of a dog and if in that same% textview
says cat the image appears of a cat.
Thank you in advance for the help.
I am new to programming and would like to know how to do if in android studio a textview
says Dog I get the image of a dog and if in that same% textview
says cat the image appears of a cat.
Thank you in advance for the help.
String text = textview.getText().toString();
if(text.equals("gato")){
//posiblemente: imageView.setImageResource(R.drawable.gato);
}else if(text.equals("perro")){
//posiblemente: imageView.setImageResource(R.drawable.perro);
}else{
//codigo
}