Android spinner onItemSelected Listener cannot see outside values <p>I have an <code>onItemSelectedListener</code> for my Spinner in my main activity. I assign the listener to the spinner object in the <code>onCreate</code> Method.</p> <p>The activity class has a member variable <code>int iCurrentSelection</code>. But no matter what I set <code>iCurrentSelection</code> to anywhere in the activity, it is always null in the <code>onItemSelected</code> Method. So the boolean <code>changed</code> is always <code>true</code> even if nothing has changed.</p> <p>I do not understand why! Somebody please enlighten me :-)</p> <p>Here is my listener class:</p> <pre><code>OnItemSelectedListener oisl = new OnItemSelectedListener(){ public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { boolean changed = iCurrentSelection != arg0.getSelectedItemPosition(); stopTracks(); if(changed){ iCurrentSelection = arg0.getSelectedItemPostion(); initTracks(actSpeed); } } @Override public void onNothingSelected(AdapterView&lt;?&gt; arg0) { } } </code></pre>