title: How to access different array data in onItemSelected?
body: <p>I'm trying to implement multiple spinners within one activity, which appears to be working ok. The problem I have is when I'm trying to output their options using onItemSelected, I can't work out how to tell this method which spinner was just updated. I'll copy the code in but here is the extract from the onItemSelected method. Which for example if I had two spinners would only show me results from intTypeItems spinner. </p>
  
  <pre><code>    public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id) {
      selection.setText(intTypeItems[position]);
  }
  </code></pre>
  
  <p>Here is the full Class I'm working with.</p>
  
  <pre><code>public class Calculator extends Activity implements AdapterView.OnItemSelectedListener {
      private TextView selection;
      private static final Integer[] intNoItems={1,2,3};
      //private static final String[] intNoItems={"one","two","three"};
      private static final String[] intTypeItems={"Seconds","Minutes","Hours","Days"};    
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.calculator);
      Spinner intNo=(Spinner)findViewById(R.id.intervalNo);
      Spinner intType=(Spinner)findViewById(R.id.intervalType);
  
      intNo.setOnItemSelectedListener(this);
      intType.setOnItemSelectedListener(this);
  
      selection=(TextView)findViewById(R.id.outPutValues);
  
      ArrayAdapter&lt;Integer&gt; intNolist=new ArrayAdapter&lt;Integer&gt;(this, android.R.layout.simple_spinner_item,intNoItems);
      ArrayAdapter&lt;String&gt; intTypelist=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item,intTypeItems);
  
      intNolist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      intTypelist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      intNo.setAdapter(intNolist);
      intType.setAdapter(intTypelist); 
  }
  
  public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id) {
      selection.setText(casting + intTypeItems[position]);
  }
  
  @Override
  public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
      // TODO Auto-generated method stub
  }
  
  }
  </code></pre>
  
  <p>One of the spinners is a int the other a string, so I'll also need to cast the int to string when outputting to my selection text view. Which again I'm not sure how to do, as the cast would cause an exception when the string gets the callback?</p>