I took the android key event code from the blog “Android-izing a Mobile app”. The problem I have over here is that I have put the code and build a test apk. Once I install it in my device. I navigate to Scene 2, once I press and release Back button I should go to home view. But when I press Back it closes the app. The different thing which is happening over here is that if I press Back and just slide my finger onto screen then I navigate back to Home screen, but if I just press and release on Back button itself then it crashes. I mean closes the app
In your key event listener always return true if you do not want the button to do what it normally does.
The code below in the listener prevents the back button from closing the app, but then you have to implement another way of closing it (if you want to).
if event.phase == “up” and event.keyName == “back” then
return True
Thank You So much, that solved the problem
In your key event listener always return true if you do not want the button to do what it normally does.
The code below in the listener prevents the back button from closing the app, but then you have to implement another way of closing it (if you want to).
if event.phase == “up” and event.keyName == “back” then
return True
Thank You So much, that solved the problem