title: why toast message doesn't appear in my application at item clicked?
body: <p>I am working on a simple spinner. I wanna to show a toast message at any item clicked but it doesn't work.I don't know where the logical error is. Any help will be appreciated.
  This is my code:</p>
  
  <pre><code>public void onItemSelected(AdapterView&lt;?&gt; adapter, View view, int position, long id) {
      // On selecting a spinner item
      String itemSelected = adapter.getItemAtPosition(position).toString();
      int temp=Integer.parseInt(itemSelected);
      switch (position) {
      case 0:
          Toast.makeText(getApplicationContext(), "Selected: user", Toast.LENGTH_LONG).show();
          break;
      case 1:
          Toast.makeText(getApplicationContext(), "Selected:  page", Toast.LENGTH_LONG).show();
          break;
      }
  
      // Showing selected spinner item
  //Toast.makeText(adapter.getContext(), "Selected: " + itemSelected, Toast.LENGTH_SHORT).show();
  }
  </code></pre>