i have a EditText which always contains an integer...but sometimes also contains the text..how do I check if my string contains text fields in the EditText? Thanks in advance.
I would approach the problem in the following manner:
String mEditText = mDisplay.getText().toString();
if(mEditText.matches("[0-9]+")) {
// mEditText only contains numbers
} else {
// mEditText contains number + text, or text only.
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With