title: How to assign different image views in each item of the spinner?
body: <p>I want to display different image views in each items in my <code>spinner</code> and indicate their position. My problem is, the <code>spinner</code> can only display one <code>ImageView</code>.</p>
  
  <pre class="lang-java prettyprint-override"><code>states = getResources().getStringArray(R.array.Facilities);
  imgs = getResources().obtainTypedArray(R.array.popup);
  
  image = (ImageView) findViewById(R.id.country_image);
  spinner = (Spinner) findViewById(R.id.country_spinner);
  
  ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this,
          android.R.layout.simple_spinner_item, states);
  dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  spinner.setAdapter(dataAdapter);
  
  spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
  {
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View view,
                                 int position, long id) {
          image.setImageResource(imgs.getResourceId(
                  spinner.getSelectedItemPosition(), -1));
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
  
      }
  });
  </code></pre>