In xml, you can simply add this line to the Spinner element:
android:clickable="false"
Then you can display the information you need, but it is not available. If you need to do this programmatically, you can simply use this line of code:
mySpinner.setClickable(false);
And just in case, you need to know how to display certain information:
Spinner mySpinner = (Spinner) spinnerlayout.findViewById(R.id.myspinner); //Here you set the String array to use ArrayAdapter<CharSequence> adapter = ArrayAdapter .createFromResource(this, R.array.STRING_ARRAY_USED, R.layout.spinner); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mySpinner.setClickable(false); mySpinner.setAdapter(adapter); mySpinner.setSelection(HERE YOU SET THE INDEX OF THE ARRAY ITEM TO SHOW); mySpinner .setOnItemSelectedListener(new MyOnItemSelectedListener());
source share