How can I change the colour of the error message that can be set to appear below the text field in a TextInputLayout
(via setError(...)
– see error
UPDATE
Please use a custom view instead and not this
A modded version of @jared's Answer which works in my case :
public static void setErrorTextColor(TextInputLayout textInputLayout, int color) {
try {
Field fErrorView = TextInputLayout.class.getDeclaredField("mErrorView");
fErrorView.setAccessible(true);
TextView mErrorView = (TextView)fErrorView.get(textInputLayout);
mErrorView.setTextColor(color);
mErrorView.requestLayout();
} catch (Exception e) {
e.printStackTrace();
}
}