Good morning everyone, I am using this code to add and handle a BarButton
B4X:
Sub AddOwnBackButton
Page1.HideBackButton = True
backbut.InitializeText("< Back", "GoBack")
Page1.TopLeftButtons= Array(backbut)
End Sub
Sub Page1_BarButtonClick (Tag As String)
If Tag = "GoBack" Then
If bShowingStartPurchase = True Then
ReloadOriginalLayout
bShowingStartPurchase = False
Else
If KeyboardHeight > 0 Then
Page1.ResignFocus
Else
NavControl.RemoveCurrentPage
End If
End If
End If
End Sub
The intention is if it has not started the Purchase feature, to hide the keyboard if it is visible and if it is not to set the application in background.
The latter does not work. I cannot "exit" then application by setting it to background. How is this done? The code is in main.