title: Spinner not showing selected item in android
body: <p>I'm using Spinner in my Application, while resuming from another screen, it is displaying the first item in it, but the old item is selected. I'm using the following code, Any one please help me.</p>
  
  <pre><code>Spinner= (Spinner) findViewById(R.id.spinner1);
  dataAdapter=null;
  dataAdapter = new ArrayAdapter&lt;String&gt;(this,android.
       R.layout.simple_spinner_item, country);
  
  dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  Spinner.setAdapter(dataAdapter);
  if (myPrefs.getBoolean("isChecked", false)) {
      Spinner.setSelection(myPrefs.getInt("PreviouslyselectedID", 0));
  }
  else
  {
      country.add(0, "Please Select");
  }
  </code></pre>
  
  <p>Thanks in advance..</p>