title: Android: two Spinner onItemSelected()
body: <p>I have two spinners (day_spin and time_spin) in one <code>Activity</code>. I want to save the selected day_spin value into a variable. Is it possible to differenciate between the two spinners in the same <code>Listener</code>? Or do I have to write my own <code>Listener</code> class for each spinner?</p>
  
  <p>Also I want to get the number of the selected item. For example I have String Array with 6 elements. I select number 3. How can I get the id?</p>
  
  <pre><code>    day_spin = (Spinner) findViewById(R.id.spinner);
      ArrayAdapter&lt;CharSequence&gt; adapter_day = ArrayAdapter
              .createFromResource(this, R.array.spinner_day_array,
                      android.R.layout.simple_spinner_item);
      adapter_day
              .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      day_spin.setAdapter(adapter_day);
      day_spin.setOnItemSelectedListener(this);
  
      time_spin = (Spinner) findViewById(R.id.spinner1);
      ArrayAdapter&lt;CharSequence&gt; adapter_time = ArrayAdapter
              .createFromResource(this, R.array.spinner_time_array,
                      android.R.layout.simple_spinner_item);
      adapter_time
              .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      time_spin.setAdapter(adapter_time);
      time_spin.setOnItemSelectedListener(this);
  </code></pre>
  
  <p>This is my <code>Listener</code>:</p>
  
  <pre><code>public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
      DAY = parent.getItemAtPosition(pos).toString();
      TIME = parent.getItemAtPosition(pos).toString();
  }
  </code></pre>
  
  <p>I hope you can help me!</p>