I am developing a storyboard-based applications with several scenes that show menus and different screens.
Almost all of these different scenes have a graphical back button in them. This button is created and defined centrally in one function.
What I want to achieve is the following: On Android, the hardware back button should behave, like the graphical back button was pressed. And furthermore I don't want to code this for all scenes separate, but only once in my "back button function".
When I add an EventListener to the Runtime at the start of the app, I already need to define a function that is going to be called when the back button was pressed. But the function I want to be called is different from scene to scene.
What I need is the possibility to throw a global "Hardware Back Button was pressed" event for the Runtime, and catch this event wherever it was pressed, individually in any given scene.
Is that possible? And if so, could you give me a small code example?
Thank you for your help!