Reputation:
I have an Activity ActivityA say. From ActivityA I start ActivityB using an Intent, sending some string data to the new activity. ActivityA gets pushed into the background, not destroyed.
Intent newActivity = new Intent(this, ActivityB.class);
newActivity.putExtras("SomeString", "important data");
startActivity(newactivity);
Now I want to manipulate the string data and send it back to AcitivtyA. Not a new instance of ActivityA, but the instance that has been paused. I am unsure how to do this. ANy help is appreciated.
Upvotes: 1
Views: 1859
Reputation: 73484
You need to start B with startActivityForResult() and override onActvityResult() in A. Before you finish B you will need to call setResult() to set the data you want to send back to A.
Read the section of Starting Activities in the documentation.
Upvotes: 2