Rahul Gupta
Rahul Gupta

Reputation: 5295

setError() does not show error on disabled edittext

I am trying to show error on a disabled edittext. The red error drawable shows up but as my edittext is disabled edittet.setEnabled(false);, there is now way to click it and hence the error popup does not show.

is there any other way to show error on a disabled edittext ?

Also is there any way to show an error on a spinner ? I am doing this :-

if(((Spinner) view).getChildAt(i) instanceof TextView)
   ((TextView)((Spinner) view).getChildAt(i)).setError("");

This shows the red error drawable but not the error

Upvotes: 3

Views: 996

Answers (1)

Bhavani Kannan
Bhavani Kannan

Reputation: 128

requestfocus() to the disabled edittext will do it

Upvotes: 1

Related Questions