title: Getting string from spinner
body: <p>I'd like to get the string that the user select from a spinner menu. It should get the string after the user select one of them and saved that string in a new variable.
  I had such a code that the new variable only could take the value of the default and it can not update what the user selected.</p>
  
  <p>The strings are</p>
  
  <pre><code>String[] models={"Model 1" , "Model 2" };
  </code></pre>
  
  <p>and my onCreate method looks like follow:</p>
  
  <pre><code>Spinner spinModel=(Spinner)findViewById(R.id.spinnerModel);
  spinModel.setOnItemSelectedListener(this);
  //creamos el spinner con las cadenas de modelos almacenadas en la variable items
  ArrayAdapter&lt;String&gt; aa= new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item,models);
  //Decimos como debe mostrar este elemento
  aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  //editamos el spinner
  spinModel.setAdapter(aa);
      //I TRIED THIS FUNCTION
  model = spinModel.getSelectedItem().toString();
  </code></pre>
  
  <p>Thank you very much to everyone!!</p>