title: How to send an ArrayList<String> to Another Activity and display there?
body: <p>How to send an ArrayList to Another Activity and display there ?
  I Want to get data from another activity and send it to another activity and get there printed. I am only able to pass single string but not an array of strings</p>
  
  <p><em>Code On Java File,</em></p>
  
  <p><strong>Main Activity:</strong></p>
  
  <pre><code>EditText et1 , et2 , et3 , et4 ;
  public final static String MESSAGE_KEY = "com.example.prabhav.myapplication.message";
  ArrayList&lt;String&gt; ar , tr = new ArrayList&lt;String&gt;();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_full_on);
  }
  
  public void sm (View v)
  {
      et1= (EditText) findViewById(R.id.name);
      String msg1 = et1.getText().toString();
      et2= (EditText) findViewById(R.id.dob);
      String msg2 = et2.getText().toString();
      et3= (EditText) findViewById(R.id.emailinput);
      String msg3 = et3.getText().toString();
      et4= (EditText) findViewById(R.id.clgi);
      String msg4 = et4.getText().toString();
      ar.add(msg1);
      ar.add(msg2);
      ar.add(msg3);
      ar.add(msg4);
      tr=ar;
      Intent intent = new Intent(this,SecAct.class);
      intent.putExtra("myarray",tr);
      startActivity(intent);
  
  }
  </code></pre>
  
  <p><strong>Another Activity:</strong></p>
  
  <pre><code>Spinner s;
  public final static String MESSAGE_KEY = "com.example.prabhav.myapplication.message";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Intent intent= getIntent();
      ArrayList&lt;String&gt; ls = (ArrayList&lt;String&gt;) getIntent().getSerializableExtra("myarray");
      ArrayAdapter&lt;String&gt; adptr=new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,ls);
      s= (Spinner) findViewById(R.id.sp);
      s.setAdapter(adptr);
  
      //  setContentView(R.layout.sec_lay);
  
  }
  </code></pre>