title: Android inflating multiple spinner causes strange selection behavior
body: <p>in the program I inflate several Spinners and add them to a layout. For each spinner I make an individual selection. This works fine if the Activity is created as usual - so every spinner gets his own selection. If the activity is created due to a rotation it will apply the value of the last spinner to all spinner and I watched that a onItemSelectedListener will be called multiple times. I am very desperate since that seems not very logic to me. Here is the code: </p>
  
  <p>SpinnerTesterActivity.xml</p>
  
  <pre><code>public class SpinnerTesterActivity extends Activity {
      public String[] array={"s0","s1","s2","s3","s4","s5","s6","s7","s8","s9"};
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          Log.d("SPINNERTESTER", "REPAINT ACTIVITY");
          LinearLayout layout=(LinearLayout)this.findViewById(R.id.parentLayout);
  
          for (int i = 0 ; i&lt;3; i++){
              LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              ViewGroup reminderLayout = (ViewGroup) layoutInflater.inflate(R.layout.edit_item, null);
              Spinner spinner = (Spinner) reminderLayout.findViewById(R.id.spinner);
              spinner.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, array));
              spinner.setSelection(i);
  
              layout.addView(reminderLayout);
  
          }
      }
  </code></pre>
  
  <p>main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:id="@+id/parentLayout" &gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>edit_item.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:paddingBottom="3dip"
      android:paddingTop="3dip" &gt;
  
      &lt;Spinner
          android:id="@+id/spinner"
          android:layout_width="0px"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="center" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>