Android Question Exiting App Warnings

Eric McDonald

Licensed User
I was wondering if there is a way to ensure a user actually wants to leave an app. For instance, I figured out the back button using KeyCodes. However, it seems that this is not available for either the home or the overview buttons.

Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        Select Msgbox2Async("Are you sure you want to exit?","WARNING","Yes","No","",Null,False)
            Case DialogResponse.POSITIVE
            Case Else
                Return True
        End Select   
    End If
End Sub

I then checked this page to see if I could find anything.

Views (Core)

It appears that message boxes cannot exist within the Activity_Pause Sub, so that (I assume) would not work.

I'm hoping I'm missing something obvious, so this might be an easy question.

Any help would be much appreciated, thanks!


Active Member
Licensed User
Longtime User
you can't do that in android, you only can handle the back button.

if you want to make an app which the user can't exit search for "Kiosk"
Upvote 0


Licensed User
Longtime User
Upvote 0