I've added input validation to a set of edit texts in a dialog message using the setError
method in Android.
But when I test it by leaving some of the edit texts blank and clicking "ok"
on the dialog, the dialog closes without triggering a prompt to enter values.
Can anyone see what is wrong with this implementation?
I think it may be something to do with a call to close the dialog before input validation is triggered.
This is how I've set the input validation based on the 4th answer in this question, Check if EditText is empty.:
else if(TextUtils.isEmpty(strColour)) {
colourText.setError("Please enter a value");
return;
}
}
dialog.cancel();
}