title: How do i add images on spinner item?
body: <p>how to put images icon on spinner in android please help me this is my spiner code how do i add images on every name in the list?? i want to show images on eact text on spinner</p>
  
  <pre><code>            Spinner sp = (Spinner) findViewById(R.id.lgnspinner);
              ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this, R.array.network_array,
                      android.R.layout.simple_spinner_item);
              adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
              sp.setAdapter(adapter);
  
              sp.setOnItemSelectedListener(new OnItemSelectedListener() {
                  public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                      if (position == 0) {
                          // text}
  
                          if (position == 1) {
  
                              // text
  
                          }
                          if (position == 2)
  
                          {
                              // text
                          }
                          if (position == 3) {
                              // text
                          }
                      }
                  }
              });
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;Spinner
      android:id="@+id/lgnspinner"
      style="?android:attr/buttonStyleSmall"
      android:layout_width="145dip"
      android:layout_height="wrap_content"
      android:prompt="@string/network_prompt"
      android:textColor="#000000" /&gt;
  
  &lt;string-array name="network_array" &gt;
  
      &lt;item&gt;
      GPRS
      &lt;/item&gt;
  
      &lt;item&gt;
      Wifi
      &lt;/item&gt;
  
      &lt;item&gt;
      OtherNetwork
      &lt;/item&gt;
  
      &lt;item&gt;
      SMS
      &lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>