The Spinner icon is only available in a few steps.
Step 1
Put the icon you want in xml:
<Spinner ... android:background="@drawable/ic_sort_white_24dp" />
Step 2
Then, in adapter Spinner , override getView() , for example:
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list){ @Override public View getView(int position, View convertView, ViewGroup parent) { // this part is needed for hiding the original view View view = super.getView(position, convertView, parent); view.setVisibility(View.GONE); return view; } };
Explanation
We need to understand that the getView() in the adapter is the view that will be used when Spinner does not open. We make the visibility gone because we donβt want to see it, so that the background Spinner from xml remains, which I already set to ic_sort_white_24dp in this example (step 1).
Do not mix with getDropDownView() , which is used for parameter strings that will be reset after clicking Spinner .
Bonus screenshot
This is how I look. Hope this helps!

source share