title: Why doesn't OnItemSelectedListener switch by view ID work to find the selected spinner?
body: <p>I have OnItemSelectedListener class and the problem is that now when i go and select item from spinner1, it doesn't show toaster text it's supposed to show. Toast text is there just to see if the listener works and it doesn't. I have two spinners and i'm trying to get selected items from both spinners for individual variables. Any help is appreciated here, i've been stuck with this for couple hours.</p>
  
  <p>I've used that switch technique on buttonlisteners and it worked fine, but they are on my main class, the activity class, im not sure if it depend on that and how to fix that if it does</p>
  
  <pre><code>@Override
  public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
  
      View v = parent.getSelectedView();
      switch (view.getId()) {
  
      case R.id.spinner1:
          Toast.makeText( parent.getContext(),
                  "Selected item is " + parent.getItemAtPosition(pos).toString(),
                  Toast.LENGTH_LONG).show();
          break;
      case R.id.spinner2:
          //Code here
          break;
      default:
          Toast.makeText(parent.getContext(), view.toString(), Toast.LENGTH_LONG).show();
          break;
      }
  }
  </code></pre>