How do I check if user enters something and it will prompt the user until he enters something and will not let him go on next page? here is the code
if (howManyQuestions != null && howManyQuestions.getText().length() != 0) {//check if user enters a numeric attribute
name2 = howManyQuestions.getText().toString();
}
else if(howManyQuestions.getText().toString().length() == 0) {//check if user doesn't enter a numeric attribute
Toast.makeText(this, "please select how many answers you are looking for..", Toast.LENGTH_SHORT).show();
return ;
}
if (howManyQuestions != null && howManyQuestions.getText().length() != 0) {//check if user enters a numeric attribute
name2 = howManyQuestions.getText().toString();
}
else if(howManyQuestions.getText().toString().length() == 0) {//check if user doesn't enter a numeric attribute
Toast.makeText(this, "please select how many answers you are looking for..", Toast.LENGTH_SHORT).show();
return ;
}