title: Work with Array of Intent and copy one Intent to another Intent
body: <p>I am having a Listview and two buttons in my Activity, </p>
  
  <p>when ADD button clicked it will call some other activity for result, that activity return a intent with data, each time diff data in the intent received, and the title only added to the listview, </p>
  
  <p>when SAVE button clicked, all the intent data would be saved in database,</p>
  
  <p>So I need to create intent array ie</p>
  
  <blockquote>
    <p>Inten[] intArray = new Intent[100];</p>
  </blockquote>
  
  <p>and I need to copy the returned Intent each time <strong>onActivityResult(Intent data)</strong> to the Intent array as</p>
  
  <blockquote>
    <p>intArray[i] = data;</p>
  </blockquote>
  
  <p>How can I achieve this, If I can do this I can solve a big problem in my Project....</p>
  
  <p>Following is the code I tried.... <strong>Intent[] intentArray = new Intent[100]; declared as this class variable</strong></p>
  
  <pre><code>@Override
  public void onActivityResult(int reqCode, int resultCode, Intent data) {
      super.onActivityResult(reqCode, resultCode, data);
      if(resultCode == Activity.RESULT_OK)
      {
          switch(reqCode)
          {
              case 1:
                  trigName = data.getStringExtra("TriggerName");
                  subName = data.getStringExtra("SubName");
  
                  intentArray[i] = data; i++;
  
                  temp = new HashMap&lt;String, String&gt;();
                  temp.put("Name", trigName);
                  temp.put("Sub", subName);
                  list.add(temp);
                  adapter.notifyDataSetChanged();
                  break;
          }
      }
  } 
  </code></pre>