Hassan Mokdad
Hassan Mokdad

Reputation: 5892

Disabling a Spinner completely and preventing it form showing it's items in android when disabled

I am setting a spinner to the diabled state by using mySpinner.setEnabled(false);

The spinner is disabled and greyed out, but when you click it on it, it shows the it's items in a menu as if it is not disabled!!!

Does any body what could be the problem? Is it a bug in android ?

Regards

Upvotes: 1

Views: 283

Answers (2)

Jitendra
Jitendra

Reputation: 1115

Use mySpinner.setClickabe(false); and mySpinner.setFocusable(false);

Upvotes: 1

zrgiu
zrgiu

Reputation: 6322

while setEnabled(false) should do the job, disabling all interaction with the spinner can be achieved by also calling both setClickable(false) and setFocusable(false)

Upvotes: 2

Related Questions