title: Spinner the setOnItemSelectedListener can't be resolved
body: <p>Ok guys i am trying to implement spinner in in Android Studio</p>
  
  <p>These are my imports</p>
  
  <pre><code>import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.Spinner;
  import android.widget.AdapterView;
  import android.widget.Toast;
  import android.widget.AdapterView.OnItemSelectedListener;
  </code></pre>
  
  <p>This is my java. Here I get the the setOnItemSelectedListner in red and says cannot be resolved. I am importing it above despite that it is showing. What could be the issue.</p>
  
  <pre><code> Spinner spinner = (Spinner) findViewById(R.id.spinner);
   spinner.setOnItemSelectedListner(this);
  </code></pre>
  
  <p>The whole code is like this....</p>
  
  <pre><code>import android.location.Address;
  import android.location.Geocoder;
  import android.location.Location;
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.Spinner;
  import android.widget.AdapterView;
  import android.widget.Toast;
  import android.widget.AdapterView.OnItemSelectedListener;
  import android.widget.AdapterView.OnItemSelectedListener;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  
  public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
  
          SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
  
      }
  
  
      Spinner spinner = (Spinner) findViewById(R.id.spinner);
  
      spinner.setOnItemSelectedListner(this);
  
  
      List&lt;String&gt; categories = new ArrayList&lt;String&gt;();
      categories.add("Automobile");
      categories.add("Business Services");
      categories.add("Computers");
      categories.add("Education");
      categories.add("Personal");
      categories.add("Travel");
  
  
      ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, categories);
  
  
      dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
  
      spinner.setAdapter(dataAdapter);
          }
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
          String item = parent.getItemAtPosition(position).toString();
  
  
          Toast.makeText(parent.getContext(), "Selected: " + item, Toast.LENGTH_LONG).show();
      }
      public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
  
      }
  </code></pre>