android - How to finish parent activity without finishing child activity in case of multiple instance of parent and child activities? -


i want make context variable static activity parent activity of child activity b. following link http://androiddhina.blogspot.in/2015/02/finish-parent-activity-from-child.html.

here workflow of activities:

first activity shown go activity b. not want finish activity until task on activity b has finished successfully.

if task successful want activity go away if user presses button goes parent of activity a. there button on activity b launches activity a.

if task has failed user can go activity pressing button. (i think in case activity b automatically finshed android).

as per link following, context of activity static , remain same if gets finished first time. doubt work correctly in case if not same when ever new instance of created. activity's context remain same multiple instances?enter image description here

i handle button b , adjust action depending on current situation:

@override public void onbackpressed() {     if (i_can_go_back_to_a) {        super.onbackpressed();     } else {         //do else... launch activity, relaunch a, whatever     } } 

Comments