Disabling Spinner in android

xain picture xain · May 13, 2011 · Viewed 71.9k times · Source

I'm having problems when using android:enabled="false", it's not disabling the component in the case it's a spinner. Don't know if it's relevant, but it belongs to a layout that's part of a viewflipper.

Any hints or workarounds ?

Thanks

Answer

himb2001 picture himb2001 · Apr 5, 2012

Disable or enable it before setting the adapter.

yourSpinner.setEnabled(false);   
yourSpinner.setClickable(false);  
yourSpinner.setAdapter(typeAdapter);