1

am having a two activities that interact. activity A picks input values and sends to activity B for the user to confirm input before submitting. activity B should allow the user to go back to activity A to edit input values if required or submit the values if they are ok. If user submits values, activity A should be finished and if he edits, then he goes back to activity A.

I have used startActivityForResult() and setResult() methods to kill the activity A when the user submits the values that has worked perfectly, but when i click the edit button to return to activity A, it call the activity A using a new Intent, and subsequently, it starts the activity A, yet previously started activity A is still running . what i want is to resume the activity A where it was left with the existing values before activity B started on click of the back button. How do i achieve this?? Your assistance is highly appreciated

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
jaydee
  • 11
  • 2
  • Take a look at the accepted solution to this question: http://stackoverflow.com/questions/6835398/why-does-heap-memory-increase-when-re-launching-an-activity – Emir Kuljanin Sep 07 '11 at 08:20

1 Answers1

4

Call finish() in Activity B when you need to edit. There is no need to fire an intent that creates new instance of Activity A. It will resume Activity A.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
Rasel
  • 15,499
  • 6
  • 40
  • 50
  • Great Rasel, that was way too easy...maybe i needed to reason out well with that..Thanks anyway..i really appreciate – jaydee Sep 07 '11 at 08:18