Sunday, November 22, 2009

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.

No comments: