title: How we can pass two ArrayList from one Activity to another with using bundles
body: <p>I want to pass two ArrayList items from my main activity to another activity i used. but everytime, it passes only last item to each of the ArrayList. how can i pass two ArrayList item in one intent and bundle?</p>
  
  <p>-ResponseActivity.java-</p>
  
  <pre><code>//buttonStatusListener()
  
  private OnClickListener buttonStatusListener = new OnClickListener() 
  {
      public void onClick(View v)
      {
          Intent i1 = new Intent(ResponseActivity.this, StatusActivity.class);
  
          ArrayList&lt;String&gt; code = new ArrayList&lt;String&gt;(); 
          code = parseddata.getCode();
          ArrayList&lt;String&gt; request = new ArrayList&lt;String&gt;();
          request = parseddata.getRequest();
  
          Bundle b = new Bundle();
          b.putStringArrayList(StatusActivity.TEXT_REQUEST, request);
          b.putStringArrayList(StatusActivity.TEXT_CODE, code);
  
  
  
          i1.putExtras(b);
  
          startActivity(i1);
      }
  };
  </code></pre>
  
  <p>-Status Activity-</p>
  
  <pre><code>public class StatusActivity extends Activity{
  
  
   ParsedDataList parseddata = null;
  
  public static String TEXT_CODE;
  public static String TEXT_REQUEST;
  
  /** Called when the activity is first created. */
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
  
      parseddata = MyXMLHandler.getExampledata();
  
      TextView textCode[] = new TextView[parseddata.getCode().size()];
      TextView textRequest[] = new TextView[parseddata.getRequest().size()];
  
      Bundle extras = getIntent().getExtras();
      ArrayList&lt;String&gt; code = new ArrayList&lt;String&gt;();
      code = extras.getStringArrayList(TEXT_CODE);
      ArrayList&lt;String&gt; request = new ArrayList&lt;String&gt;();
      request = extras.getStringArrayList(TEXT_REQUEST);
  
      LinearLayout lLayout = new LinearLayout(this);
      lLayout.setOrientation(1);
  
  
      for(int i = 0; i &lt; parseddata.getRequest().size(); i++)
      {
          textCode[i] = new TextView(this);
          textCode[i].setText("Code: " + code.get(i));
  
          textRequest[i] = new TextView(this);
          textRequest[i].setText("Request: " + request.get(i));
  
          lLayout.addView(textCode[i]);
          lLayout.addView(textRequest[i]);
      }
  
          setContentView(lLayout);
  }
  </code></pre>
  
  <p>ParsedDataList is my data class which i hold my data. Their types are also <code>ArrayList&lt;String&gt;</code>.</p>
  
  <p>At the end, my result is:</p>
  
  <pre><code>Code: 200
  Request: 200
  </code></pre>