How to set Spinner Default by its Value instead of Position?
If you are setting the spinner values by ArrayList or Array you can assign the spinner’s selection by using the value’s index. String myString = “some value”; //the value you want the position for ArrayAdapter myAdapter = (ArrayAdapter) mySpinner.getAdapter(); //cast to an ArrayAdapter int spinnerPosition = myAdapter.getPosition(myString); //set the default according to the value spinner.setSelection(spinnerPosition); … Read more