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.