Answers for "android when adding item to edittext, if input is null how to diaplay it"

2

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();
}
Posted by: Guest on July-09-2020

Code answers related to "android when adding item to edittext, if input is null how to diaplay it"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language