Check empty of EditText




To check if the content of a EditText is empty or not, the method equals() can be used.

if (EditText.getText().toString().equals(""))
{
//Do if the EditText is empty
}
else
{
//Do if the EditText is not empty
}


Where EditText is the View of the EditText.

{ 0 comments... read them below or add one }

Post a Comment