1
Hello to all I have the following Listener below which checks if an editText has been changed, the Listener will be identical to several editText so I would like to get the current editText through the "v" property, to avoid code repetition and create only one "onFocushangeCListener" and assign to multiple editText.
edtDescPer.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
executeOnChange = false;
v.focus
if (hasFocus) {
sTemp = edtDescPer.getText().toString();
edtDescPer.setText("");
} else {
if (edtDescPer.getText().toString().equals(""))
edtDescPer.setText(sTemp);
}
executeOnChange = true;
}
});
Mark your suggestion was instrumental in solving my problem. I’m going to put the code of how my role turned out in an answer, but I’m going to mark yours as correct
– Benjamim Mendes Junior