Android Question How to disable "back key"?

vecino

Well-Known Member
Licensed User
Longtime User
Hi, How to disable "back key" while showing a "spinner"?

In the "activity" I have in activity_KeyPress, but does not work when making a request for data to the user using a "spinner".

Thanks and regards.
 

Jim Brown

Active Member
Licensed User
Longtime User
See if this is helps:
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

vecino

Well-Known Member
Licensed User
Longtime User
Hi, thanks, works perfect, I have this code, but the problem is when I show a "spinner", then the user can press the "back" and not to choose any of the options. In other words, this code does not work when you are displaying a "spinner".

Thanks and regards.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hi, thanks, works perfect, I have this code, but the problem is when I show a "spinner", then the user can press the "back" and not to choose any of the options. In other words, this code does not work when you are displaying a "spinner".

Thanks and regards.

?

Are you saying that Keypress doesn't execute when the User presses the Back Button when they've selected the Spinner? Some Event must get fired...?
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I tested with inputlist and the problem is the same because it is a not modal dialog :eek:
Regards.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, what I want is that the user can not press "back key" while showing you a spinner or any other type of "view" data request.
Thank you.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I wonder is it possible to disable or remove the entire set of keys?
10277193366_16dd25f9c7_o.jpg

thanks
 
Upvote 0
Top