kas_miyulu
kas_miyulu

Reputation: 361

Remove setError from EditText xamarin android

Hi I know this question is asked before, but I'm facing a different issue. I want to dismiss the setError from editText. but the following does not work for me,

editText.setError(null);

It's expecting the other argument which is the drawable icon. I'm using visual studio xamarin android with C#.

Any help is greatly appreciated.Thanks

Upvotes: 1

Views: 655

Answers (1)

Sami Kuhmonen
Sami Kuhmonen

Reputation: 31203

Xamarin version only has the method that takes the text and icon. As the documentation says you can clear the error by making the text null and the icon should also be null in this case. So just use

editText.SetError((string)null, null);

The casting to string will make it clear to the compiler which method to use. In this case it doesn't matter.

Upvotes: 3

Related Questions