I am intercepting the KEYCODE_BACK button... but when I do a "return TRUE" to absorb the event, that disables the volume control UI.
How do I "return TRUE" from
Activity_KeyPress()
to absorb the KEYCODE_BACK, yet pass
KeyCodes.KEYCODE_VOLUME_DOWN and
KeyCodes.KEYCODE_VOLUME_UP events on so the Volume Control UI pops-up and handles them?
Ah... never mind. Too simple.
All I have to do is go:
How do I "return TRUE" from
Activity_KeyPress()
to absorb the KEYCODE_BACK, yet pass
KeyCodes.KEYCODE_VOLUME_DOWN and
KeyCodes.KEYCODE_VOLUME_UP events on so the Volume Control UI pops-up and handles them?
Ah... never mind. Too simple.
All I have to do is go:
B4X:
Sub Activity_KeyPress(KeyCode AsInt) AsBoolean'Return True to consume the event
Dim ReturnValue as Boolean
If KeyCode = KeyCodes.KEYCODE_VOLUME_UP or KeyCodes.KEYCODE_VOLUME_DOWN then
ReturnValue = False
else If KeyCode = KeyCodes.KEYCODE_BACK Then
' Handle KeyCodes
ReturnValue = True
end if
Return ReturnValue
end sub
Last edited: