Sub InputPINCode(message As String) As ResumableSub
Dim xui As XUI
Dim Dialog As B4XDialog
Dim Input As B4XInputTemplate
Input.Initialize
Input.lblTitle.Text = message
Dialog.Initialize(MainPage.RootPanel)
Input.ConfigureForNumbers(False, False) 'AllowDecimals, AllowNegative
Dialog.Title = "Enter PIN code"
Wait For (Dialog.ShowTemplate(Input, "OK", "", "Cancel")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim res As String = Input.Text 'no need to check with IsNumber
Log(res)
Return res
Else
Return "xxxx"
End If
End Sub