The solution is at the end and here is the screenshot:
Some Explanation
You might be able to set the textcolor using the following line
yourEditText.setError(Html.fromHtml("<font color='blue'>this is the error</font>"));
However, this might not be guaranteed.
According to the source code, this Popup
that shows is of type ErrorPopup
which is an internal class inside TextView
. The content of this Popup
is a single TextView
inflated from com.android.internal.R.layout.textview_hint
final TextView err = (TextView) inflater.inflate(com.android.internal.R.layout.textview_hint,
null);
The background of this Popup
depends on whether it should be placed above the anchor:
if (above) {
mView.setBackgroundResource(com.android.internal.R.drawable.popup_inline_error_above);
} else {
mView.setBackgroundResource(com.android.internal.R.drawable.popup_inline_error);
}
Since all the android resources used to create the popup are internal and ultimately hard-coded, your best shot would be to create your own error popup. This would be very easy and you wouldn't really be interfering with the normal EditText
because the default popup is merely used to show the error, and, thus, creating your own would be fine.
SOLUTION
I have created it here: WidgyWidgets
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…