Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

testing if editText is empty java

if (TextUtils.isEmpty(editText.getText().toString()))
{
    Toast.makeText(MainActivity.this, 
                   "Empty field not allowed!",
                   Toast.LENGTH_SHORT).show();
}
else 
{
    Toast.makeText(MainActivity.this,
                  "Proceed..",
                  Toast.LENGTH_SHORT).show();
}
 
PREVIOUS NEXT
Tagged: #testing #editText #empty #java
ADD COMMENT
Topic
Name
1+2 =