Android Question Back button event not behaving as expected

kostefar

Active Member
Licensed User
Longtime User
Dear All,

I want to go to a menu named "choice" in my app when pressing the back button. But what it does is loading the page, and then shows me the android desktop right after that, so it leaves the app. How do I prevend it from exiting?

Here´s my event:

Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then '
Activity.RemoveAllViews
Activity.loadlayout ("choice")
End If
End Sub

Thanks in advance!
 

Cableguy

Expert
Licensed User
Longtime User
add "return true" just before end sub
 
Upvote 0
Top