title: How to change a spinner's list background color in Android
body: <p>I'm creating a new spinner dynamically, how can I change my list background color?</p>
  
  <p>the current background color is some dark gray:</p>
  
  <p><img src="https://s10.postimg.cc/dkxj9kkyh/image.png" alt="two muppets">
  When I'm changing the spinner's background attribute to white, i'm getting this unwanted situation:</p>
  
  <p><img src="https://s2.postimg.cc/wnl6pjqfd/image.png" alt="two muppets">
  I want it to be transparent in the activity, and only when i'm opening the spinner (press on it), I want the background will be white.</p>
  
  <p>Here is the code that I'm creating the spinner with:</p>
  
  <p>I'm creating the adapter with:</p>
  
  <pre><code>    mAdapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), 
                                       R.layout.spinner, R.id.Language, lang);
      LinearLayout layoutHolder = 
                           (LinearLayout)findViewById(R.id.RegisterFormLayout);
      Spinner spinner = new Spinner(getApplicationContext());
      LayoutParams layParams= new 
                  Spinner.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,       
                                           ViewGroup.LayoutParams.WRAP_CONTENT);
      spinner.setLayoutParams(layParams);
      spinner.setAdapter(mAdapter); 
      spinner.setOnItemSelectedListener(new myOnItemSelectedListener());
      if (lang != null)
         spinner.setSelection(lang.intValue());
      spinnerList.add(spinner);
      layoutHolder.addView(spinner);
  </code></pre>
  
  <p>my spinner.xml layout is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical" 
  android:id="@+id/SpinnerLayout"&gt;
  
  &lt;TextView
      android:id="@+id/Language"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textColor="#ffffff"
      android:background="#00ffffff"
      android:padding="5dp" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>any suggestion?</p>