title: setOnItemSelectedListener of Spinner does not call
body: <p>I used <strong>setOnItemSelectedListener</strong> to specify which item is selected in a spinner, but i think it is not called. it should print "It works" when the program runs.</p>
  
  <p>XML code:</p>
  
  <pre><code>&lt;Spinner
      android:id="@+id/quantity"
      android:layout_width="94dp"
      android:layout_height="27dp"
      android:layout_x="11dp"
      android:layout_y="118dp"
       /&gt;
  </code></pre>
  
  <p>Java code:</p>
  
  <pre><code>public class quantity extends Activity
  {
  
  Spinner  quantity;
  
  
      public void onCreate(Bundle savedInstanceState) 
      {
      quantity=(Spinner)findViewById(R.id.quantity);
  
      quantity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() 
              {
                  public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) 
                  {
                      Object item = parent.getItemAtPosition(pos);
  
                      System.out.println("it works...   ");
  
                  }
  
                  public void onNothingSelected(AdapterView&lt;?&gt; parent) 
                  {
  
                  }
              });
  
  
      }
  
  }
  </code></pre>