Here is a the code to check if EditText is not empty in android and if it's empty it will make a toast message on screen. After showing message it will return to last activity.
** here etHeight is the EditText component.
if(etHeight.getText().toString().trim().equals("")|| etWeight.getText().toString().trim().equals("")){
Toast.makeText(this, "plz don't leave any blank textbox ", Toast.LENGTH_SHORT).show();
return;
}
else{
//WRITE YOUR CODE HERE }
PLZ GIVE CONSTRUCTIVE COMMENTS.
** here etHeight is the EditText component.
if(etHeight.getText().toString().trim().equals("")|| etWeight.getText().toString().trim().equals("")){
Toast.makeText(this, "plz don't leave any blank textbox ", Toast.LENGTH_SHORT).show();
return;
}
else{
//WRITE YOUR CODE HERE }
PLZ GIVE CONSTRUCTIVE COMMENTS.
No comments:
Post a Comment