How to pass arrays to a subactivity (android)?
<p>My program is basically a list of items, and when you click the items it sends you to an expandable list. The problem is, my list of items is hundreds of items long, so it becomes tedious to have to make a different expandable list class for each one. Instead, I want to send different arrays to one subactivity depending on which list option was pressed.</p>

<p>Here's the part of my code in my main activity that is supposed to send the info:</p>

<pre><code>if ((String) ((TextView) view).getText() == "Name of List Item") {
               Intent myIntent = new Intent(view.getContext(),
                     SubActivity.class);
               myIntent.putExtra("parents", new String[] { "bunch of parents" });
               myIntent.putExtra("children", new String[][] {
                           { "bunch" },
                           { "of" },
                           { "children"} });
               startActivityForResult(myIntent, 0); }
</code></pre>

<p>Here's the part of my code that is supposed to receive it:</p>

<pre><code>String[] parents;              //declared outside onCreate() so they can be used by methods like createParentList()
String[][] children;

public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      Bundle b = this.getIntent().getExtras();

      moves = b.getStringArray("parents");
      parents = (String[][]) b.getSerializable("children");   
</code></pre>

<p>I go on to try to use createParentList()/createChildList(), etc for my expandable list. It compiles perfectly fine. However, whenever I run it and try to click on the list item, it says that the process has stopped unexpectedly. Does anyone know what is wrong?</p>
