This is regarding handling of AndroidApplication.activityBackPressedEvent. It is obvious that we may want to handle the way back button works differently based on page to page. The events added on the back page stay alive even when we move to another page where we want to add a different functionality for back button.
To make it clear, I have created a playground example for android https://play.nativescript.org/?template=play-tsc&id=oyM8O7&v=8.
Steps: Move across the pages by clicking on the buttons and then press back button on android. You would see multiple dialogs appearing from functions we added on different typescript pages.
How can we remove these functions which we added on previous pages?