title: Android Spinner not showing up
body: <p>Can anyone tell me why my spinners are not showing up? I'm doing an exercise and I don't understand why my spinners show no items at all. any suggestions?</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.widget.AdapterView.OnItemSelectedListener;
  import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.Spinner;
  import android.widget.TextView;
  import android.view.Menu;
  import android.view.View;
  import android.widget.AdapterView;
  import java.util.*;
  
  public class Length extends Activity{
  
      private Spinner spi1,spi2,cmbOpciones;
      @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.length);
  
      //Spinner1
      List&lt;String&gt; imperialunits = new ArrayList&lt;String&gt;();
      imperialunits.add("inch");
      imperialunits.add("foot");
      imperialunits.add("yard");
      imperialunits.add("mile");
  
      ArrayAdapter&lt;String&gt; adaptador = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, imperialunits);
  
      spi1=(Spinner)findViewById(R.id.spinner1);
  
      adaptador.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      spi1.setAdapter(adaptador);
  
      //Spinner2
      final String[] SIunits =
               new String[]{"km","m","cm"};
  
      ArrayAdapter&lt;String&gt; adaptador2 = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, SIunits);
      spi2 = (Spinner)findViewById(R.id.spinner2);
      adaptador2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spi2.setAdapter(adaptador2);
  
      //Spinner 3
      final String[] datos = new String[]{"Elem1","Elem2","Elem3","Elem4","Elem5"};
  
      ArrayAdapter&lt;String&gt; adaptador3 = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, datos);
  
      cmbOpciones = (Spinner)findViewById(R.id.CmbOpciones);
  
      adaptador.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      cmbOpciones.setAdapter(adaptador3);
         }
  
  }
  </code></pre>