0

As I mentioned in the title, I have two questions.

1) I have user details' form in three activities.

Activities Heirarchy:

ActivityOne ---> ActivityTwo--> ActivityDetails1---> ActivityDetails2---->ActivityDetails3---> ResultActivity.

In this hierarchy, details form starts from ActivityDetails1. Submit button is in ActivityDetails3. So when I click submit button, I am submitting all the details that are entered in 3 activities to a database.If the submission is successfull, I am going to other activity(ResultActivity) by intent.

If it fails it stays on the same ActivityDetails3. Whenever submission is sucessfull, I need to finish the 3 of the ActivityDetails activities besides going to other activity. For this I am finishing these 3 activities by accessing contexts by making them static as the marked answer in this link. But this seems inefficient as the static contexts may cause memory leaks. Can some one suggest me an efficient way to do this?

2) After the submission is successful, I have to update even ActivityOne and ActivityTwo apart from going to other activity(ResultActivity) by setting the actionbar items title with one of the details submitted by the user. I am able to make the later activities update the title, but not the previous activities. Can someone please guide me how to refresh the previous activities which are in stack, so that my title of the action item on the actionbar would be changed on previous activities too.

I would be thankful, if someone can help me on my above two questions. Relevant code snippets are appreciated.

Community
  • 1
  • 1
rick
  • 4,665
  • 10
  • 27
  • 44

1 Answers1

0


Dont type any large paragraphs.Because no one had a patient to read a large paragraph
Type your issues,problemms,what you want in brief,simple,easy to understand.

Refer the below scenarios Activity A and Activity B. From A go to B.If B do some operation and finishes then the result is updated in A.
In the above scenario you use following techniques Put protected void onActivityResult(int requestCode, int resultCode, Intent data) and handled the updation after exit of B in A and in B before call to finish() set the result code as you required

SIVAKUMAR.J
  • 4,258
  • 9
  • 45
  • 80
  • Thanks for your time. Can you please read my question now? I know this we can finish one activity by the onActivityResult. But I have two previous activities to be finished. BTW I don't think this is very lengthy explanation when compared to many other questions. – rick Jan 04 '13 at 14:33