How to change a spinner's list background color in Android

I think this requirement can't possible through theme changes. Because Spinner constructor assigns value on popupBackground attr only if you write in layout xml otherwise it will use default theme value. like below

   <Spinner
    android:id="@+id/spinner1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:popupBackground="@android:color/holo_green_dark" />

// just try changing popup background


The solution for this is to add this code when creating the spinner dynamically:

spinner.setPopupBackgroundResource(R.drawable.spinner);

and to create spinner.xml under Drawable folder:

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <solid android:color="#ffffff" />
</shape>

This solution require API level of 16 and above.

the outcome:

two muppets


To solve your problem,try this.

android:popupBackground="#00826b"