I have following small block of code to set validation on edit text when a button is pressed and display the validation message in a dialog.
Java Code
setContentView(R.layout.addnewcontacts);
Button buttonSave = (Button) findViewById(R.id.buttonSave);
final EditText editTextName = (EditText) findViewById(R.id.editTextName);
buttonSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
if (editTextName.getText().toString().length() == 0) {
editTextName.setError( "First name is required!" );
}
}
});
}
Code is working fine but the popup is not displaying text in it.
Screen shot :
Why popup is not showing text?