ccrunner863
ccrunner863

Reputation: 17

EditText.setError(null) not working in Xamarin

I'm having a little trouble with Xamarin's implementation of Android EditText.setError.

Most of the answers around here say that to dismiss an error message you just call setError(null), but Xamarin won't compile with it, claiming that no overload accepts only 1 argument. Unfortunately, giving it setError(null, null) is also not working because there are two overloads that use two arguments and it doesn't know which one to use (and will not compile).

Any ideas?

Upvotes: 1

Views: 737

Answers (1)

matthewrdev
matthewrdev

Reputation: 12200

Cast the first null argument in SetError to either string or Java.Lang.ICharSequence:

EditText editText;
editText.SetError((string)null, null);
editText.SetError((Java.Lang.ICharSequence)null, null);

Upvotes: 2

Related Questions