I have an array
String[] Array = {"+", "-", "*", "/"}
and an EditText string
operation = (EditText) findViewById(R.id.operation);
So, I have a button where I want to add an if statement like:
Button.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if(operation.getText().toString().endsWith(Array.toString())){
prinln("Example"); }
}
});
I don't know how to make this right. How to write the if statements where the String ends with any value of array and make it work