title: Android spinner position and if statements
body: <p>Having an odd issue here and don't know why it doesn't work, I'm not that used to java yet.
  to determine the selected item what needs to be done?
  the spinner has 8 items and 'position' never = 1, or any other number.
  <code>onItemSelected()</code> is definitely getting fired so is the if statement wrong? </p>
  
  <pre><code>public void onItemSelected(AdapterView parent, View v,int position, long id) {
  
      if (position == 1) //do something
  }
  </code></pre>
  
  <p>EDIT:
  thanks Lion
  it turns out position doesnt seem to do anything. however, this works.</p>
  
  <pre><code>String s = parent.getSelectedItem().toString();
  if (s == "1")//do something
  </code></pre>