to check Edittext as empty ,where myeditText
is your edittext
if(myeditText.getText().toString().trim().length() == 0)
Or use below function
private boolean isEmpty(EditText myeditText) {
return myeditText.getText().toString().trim().length() == 0;
}
If function return false
means edittext is not empty and return true
means edittext is empty
For more info see this best link Check if EditText is empty.