0
EditText edittext = (EditText)findViewById(R.id.etEditView);
if (edittext .getText().toString().isEmpty())
edittext.setError("Fill detail");

If the value is empty it shows error dialog but as the background is white and the textcolor is also white the error is not visible.

How can I change the color of the background and textcolor??

Martin Gamulin
  • 3,855
  • 21
  • 25
Lokesh Tiwari
  • 10,496
  • 3
  • 36
  • 45

1 Answers1

0

You can use following piece of code to change the textcolor of error text:

edittext.setError(Html.fromHtml("<font color='red'>Fill Detail</font>"));
Zahan Safallwa
  • 3,880
  • 2
  • 25
  • 32