Suppose in an android application, there are 4 activities. The first one 'A', list down orders. The second one 'B', is a form to create new orders. The third one 'C', is a confirmation on what the user has put in 'B'. While the forth one 'D' is an activity that show the loading progress of submitting the order. In normal flow, the user go from A to B to C and to D.
My question is, what should I do so that when its on 'D', and it has been completed, when user press back, it goes directly to 'A'. And when the user is in 'C', the user can press back to go to 'B' (meaning any modification should not alter this). Also, what if 'A' is not the first activity, meaning there is 'E' which start before 'A' and when the user is in 'C' and user press back, it should go to 'A' instead of 'E'.
I would prefer if the solution does not involve fragment. Not that It can't be used, but suppose you can't use it, what would you do? Thanks in advance.