I want to implement the following logic. I have 4 activites A, B, C and D.
The flow is A -> B -> C -> D
When the user navigates from A -> C he should be able to get back to the previous activities by pressing the back button. But after reaching D pressing the back button should take him to activity A. And pressing the back button againg should exit the application instead of taking him back to B / C / D. How do I do it.