title: Error with spinner.setOnItemClickListener() inside Fragment
body: <p>I'm new to Android development, I having some problem which unable to resolve.
  I tried to implement a <strong>Spinner</strong> inside <strong>Fragment</strong>, now it having problems with the <strong>spinner.setOnItemClickListener()</strong> method,</p>
  
  <p>It showing an error message:</p>
  
  <blockquote>
    <p>"setOnItemClickListener
    (android.widget.AdapterView.OnItemClickListener) in Spinner cannot be
    applied to (anonymous
    android.widget.AdapterView.OnItemSelectedListener)</p>
  </blockquote>
  
  <p>Here is my code:  </p>
  
  <pre><code>public class CheckAvailabilityFragment extends Fragment {
    Spinner spinner;
    ArrayAdapter&lt;CharSequence&gt; adapter;
  
    @Override
    public View onCreateView(LayoutInflater inflater, final ViewGroup container,
                           Bundle savedInstanceState) {
      final View rootView = inflater.inflate(R.layout.fragment_check_availability, container,false);
      spinner = (Spinner)getView().findViewById(R.id.spinner);
      adapter = ArrayAdapter.createFromResource(getActivity().getBaseContext(),R.array.venue,android.R.layout.simple_list_item_1);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spinner.setAdapter(adapter);
  
      spinner.setOnItemClickListener(new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
            Toast.makeText(getBaseContext(), parent.getItemAtPosition(position) + " selected", Toast.LENGTH_SHORT).show();
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; parent) {
  
          }
      });
      return rootView;
    }
  }
  </code></pre>