Replies: 2 comments 2 replies
-
Toga doesn't currently have any way to bind to the Android-level "back" button. I don't use Android as my daily-driver, so I don't have complete day-to-day experience - but as I understand it, every app will exit if you press the back button while on the home screen - that's what the back button is for. It's a context sensitive in-app navigation aid. If you're deep in a navigation tree, it takes you back to the previous page of content; if you're at the top level of the app, it takes you "back" to the home page. If my understanding is incomplete or incorrect, I'm willing to be corrected; but I know it's not just an "exit" button, so attaching handling to on_exit wouldn't be appropriate; In general, Toga isn't likely to provide overrides for functionality that reflects core UX motifs from the operating system. |
Beta Was this translation helpful? Give feedback.
-
I see, so without having any clou how the underlying android framework works: |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have a button which shows a different box with widgets when pressed. E.g.
button = toga.Button("Button",on_press=self.switch) def switch(self, widget): self.main_window.content=self.box2
Now pressing the back button closes the app.
How can I make it to show box1 again. Do I have to catch the "on_exit" event and keep my internal history to prevent closing the app?
Beta Was this translation helpful? Give feedback.
All reactions