Creating a setError() for the Spinner

Similar to @Gábor’s solution, but I didn’t need to create my own adapter. I just call the following code in my validate function (i.e. on submit button clicked)

        TextView errorText = (TextView)mySpinner.getSelectedView();                  
        errorText.setError("anything here, just to add the icon");
        errorText.setTextColor(Color.RED);//just to highlight that this is an error
        errorText.setText("my actual error text");//changes the selected item text to this

Leave a Comment