If I have understood your question correctly
I would personally do this,
Fist of all I will get the user input into a String
String example = editText.getText().toString().trim()
if(example.equals("")
{
editText.setError("Your error message");
}
else
{
}
Add this on your OnClickListener()for the button