title: Passing spinner selection between activities
body: <p>I have 4 activity with spinner inside every activity and this spinner include 3
  string data (drop-down selection), when I pass from activity to another one I must pass this selected data inside spinner like if I have chosen data x from the list in the spinner and click in button the selected data must be in second activity spinner as x too.
  I read several solutions without any solving. I hope to solve it here and this is my code for spinner and where to put the intent code</p>
  
  <pre><code>public class Page1 extends AppCompatActivity {
      Spinner spinner;
      ArrayAdapter adapter;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_page1); 
  
      spinner = (Spinner)findViewById(R.id.spinner);
      adapter =   ArrayAdapter.createFromResource(this,R.array.film_type,android.R.layout.simple_spinner_item);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
      spinner.setAdapter(adapter);
      spinner.setOnItemSelectedListener(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_LONG).show();
  
              switch (position)
              {case 0:
                  btn[0] = (FloatingTextButton) findViewById(R.id.btn);
                  btn[0].setOnClickListener(new View.OnClickListener() {
                      public void onClick(View v) {
                          try {
                              double thick = Double.valueOf(editText1.getText().toString());
                              double width = Double.valueOf(editText2.getText().toString());
                      }
                  });
                  break;
                  case 1:
                      btn[0] = (FloatingTextButton) findViewById(R.id.btn);
                      btn[0].setOnClickListener(new View.OnClickListener() {
                          public void onClick(View v) {
                              try {
  
                              } catch (NumberFormatException e) {
                                  //not a double
                              }
                          }
                      });
                      break;
              }
          }
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
      }
  });
  </code></pre>