Tabview android back navigation


I have an app with 4 Tabs on the initial screen. When pressing the Anroid back button, the app should navigate to the tab on which the user was before. I am using nativescript-angular. But a solution would also be fine for vanilla nativescript. I might change to vanilla then.

I tried it like this:
    AndroidApplication.activityBackPressedEvent, (data: AndroidActivityBackPressedEventData) => {
        data.cancel = true; // prevents default back button behavior
    }, this);

When I do this, nothing happens, because there are no previous pages. It seems as the navigation to other tabs are not tracked in the router. This might be, because the navigation to other pages always goes to “/home”.



I extended an example of named router outlets:

Is it possible to nav back to the previous tab?