Android Question inhibit the rear back button

sultan87

Active Member
Licensed User
Longtime User
hello,
I wish to inhibit the rear back button of the smartphone only for the current application
how to do ?
best regards
 

An Schi

Well-Known Member
Licensed User
In the below example you can put in what your back key should do.
Or put in nothing to do nothing.

B4X:
Sub Activity_KeyPress (key As Int) As Boolean
    ' BACK key pressed
    If key=KeyCodes.KEYCODE_BACK Then
            ' I want to capture the key here so I return True
            Return True
    End If
    ' Returning False signals the system to handle the key
    Return False
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…