Just add this code to the Activity that you want to intercept the back key with:
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Log("Keypress: " & KeyCode)
Select Case KeyCode
Case KeyCodes.KEYCODE_BACK
'....handle the back key event yourself here ...
Return True 'returning true tells the OS that you handled the keypress event and that the OS should not do anthing further
End Select
End Sub