Android Question B4XPages KeyPress

Maicon

Member
Licensed User
Longtime User
How to use KeyPress with B4XPAGES?
I have a webview in B4XMainPage and I would like to use the command webview.back, I don't know how to work with keypress in separate classes



Main:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK  Then
        Log("teste1")
        Return True
    End If
        

    Return B4XPages.Delegate.Activity_KeyPress(KeyCode)
End Sub



B4XMainPage:
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    webPage.LoadUrl(link)
    pSplash.Color = xui.Color_Blue
    pSplash.SetColorAnimated(3000,Colors.Blue,Colors.Cyan)
    Sleep(1500)
    pSplash.Visible = False
    webPage.Visible = True
    
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
 
Upvote 0
Top