App having screen1, screen2, screen3 , screen4
user can go to screen3 from remaining 3screens
if user clicks on back button in screen3
then he should be redirected to screen1(if he comes from screen1) or screen2 (if he comes from screen2)
but should not go to screen4
i tried finish() in screen3
functionality is missing
how can i solve this,
please help me
Thank you in advance.
You’ll want to look into Intent flags. Intent.FLAG_ACTIVITY_NO_HISTORY can be used so that you can’t go back to an activity.