Action Navigation Logic

I have 3 actions ... at the first event there is a button that launches the third activity. Problem in: When I am in the 3rd activity, click the "Back" button to go to the 1st operation, but I need to do the 2nd. My stack of operations should always look like this: 1. first activity 2. second activity 3. Third activity

How to do it? Thank...

+3
source share
2 answers

You can intercept the back button from step 3:

@Override
public void onBackPressed() {
    // start Activity 2
    return;
}

See this article for more details .

Note: this only works with Android 2.0 or later.

+1
source

2- , - , , 1- → 3- - , onKeyDown BACK, .

+2

Source: https://habr.com/ru/post/1791710/


All Articles