I am having a Listview and two buttons in my Activity,
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,
when SAVE button clicked, all the intent data would be saved in database,
So I need to create intent array ie
Inten[] intArray = new Intent[100];
and I need to copy the returned Intent each time onActivityResult(Intent data) to the Intent array as
intArray[i] = data;
How can I achieve this, If I can do this I can solve a big problem in my Project....
Following is the code I tried.... Intent[] intentArray = new Intent[100]; declared as this class variable
@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<String, String>();
temp.put("Name", trigName);
temp.put("Sub", subName);
list.add(temp);
adapter.notifyDataSetChanged();
break;
}
}
}