title: Android: passing a spinner selection to a new activity
body: <p>I am working on a project where a user selects up to five options from spinners, I am wanting to display the selected options in a new activity when a submit button is pressed I have a new activity opening on button press but nothing displaying, I am wanting help with the steps I need to do, Here is my code for the second screen where the data is to be displayed </p>
  
  <pre><code>    public class SecondScreenActivity extends Activity {
  
      TextView FirstIwi;
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.selected_iwi);
  
  
  
  
  
          FirstIwi = (TextView) findViewById(R.id.spinner1);
  
           Intent intename = getIntent();
  
  
          String iwi1 = (String) intename.getSerializableExtra("USERNAME"); 
          //Spinner spinnername2 = (Spinner) findViewById(R.id.spinner2);
  
  
  
          FirstIwi.setText("First Iwi" + iwi1);
  
  
      }
  }
  </code></pre>
  
  <p><strong>First class</strong></p>
  
  <pre><code>    import android.app.Activity;
      import android.content.Intent;
      import android.os.Bundle;
      import android.view.Menu;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.Button;
      import android.widget.Spinner;
  
  public class IwiSelect extends Activity {
  
      Spinner spinner1, spinner2, spinner3, spinner4, spinner5;
      Button btnSubmit; 
      String iwi1;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_iwiselect);
  
          addListenerOnButton();
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_iwi_select, menu);
          return true;
      }
  
  
  
  
      // get the selected drop down list value
        public void addListenerOnButton() {
  
          spinner1 = (Spinner) findViewById(R.id.spinner1);
          spinner2 = (Spinner) findViewById(R.id.spinner2);
          spinner3 = (Spinner) findViewById(R.id.spinner3);
          spinner4 = (Spinner) findViewById(R.id.spinner4);
          spinner5 = (Spinner) findViewById(R.id.spinner5);
  
          btnSubmit = (Button) findViewById(R.id.btnSubmit);
  
          btnSubmit.setOnClickListener(new OnClickListener() {
  
              public void onClick(View view) {
  
                  iwi1 = spinner1.toString();
                  //Starting a new Intent
                  Intent nextScreen = new Intent(IwiSelect.this, SecondScreenActivity.class);
  
                  //Sending data to another Activity
                  nextScreen.putExtra("USERNAME", iwi1);
                  //nextScreen.putExtra(spinner2.getContext().toString(), false);
  
  
  
  
  
                  // starting new activity
                  startActivity(nextScreen);
  
  
  
  
      }
          });
  
        }
        }
  </code></pre>