I have an EditText in android for users to input their AGE. It is set an inputType=phone. I would like to know if there is a way to check if this EditText is null>
First Method
Use TextUtil library
if(TextUtils.isEmpty(editText.getText().toString()) { Toast.makeText(this, "plz enter your name ", Toast.LENGTH_SHORT).show(); return; }
Second Method
private boolean isEmpty(EditText etText) { return etText.getText().toString().trim().length() == 0; }