Hi,
With the following(example) code the first time the 'Wait For (NameDialog.ShowTemplate(Help, "OK", "", "CANCEL")) Complete (Result As Int)' line (28) is run no keyboard is shown, after that it shows.
It is shown if the 'Wait For Msgbox_Result (Result As Int)' line (9) is commented and a 'Msgbox_Result' sub used or if the 'Sleep(0)' line (19) is uncommented.
I can use the sleep(0) option but was just interested as to why it fails
With the following(example) code the first time the 'Wait For (NameDialog.ShowTemplate(Help, "OK", "", "CANCEL")) Complete (Result As Int)' line (28) is run no keyboard is shown, after that it shows.
It is shown if the 'Wait For Msgbox_Result (Result As Int)' line (9) is commented and a 'Msgbox_Result' sub used or if the 'Sleep(0)' line (19) is uncommented.
I can use the sleep(0) option but was just interested as to why it fails
B4X:
Dim newname As String = "a name"
Msgbox2Async(newname & " exists, do you want to replace it?", "Existing Layout", _
"Yes", _
"Cancel", _
"No", _
Null, _
True)
Wait For Msgbox_Result (Result As Int)
Select Case Result
Case DialogResponse.POSITIVE
'...
Case DialogResponse.NEGATIVE
'...
Case DialogResponse.CANCEL
'...
End Select
'Sleep(0)
Dim NameDialog As B4XDialog
NameDialog.Initialize(Activity)
NameDialog.Title = "Please enter a name"
Dim Help As B4XInputTemplate
Help.Initialize
Help.lblTitle.Text = " Use something descriptive!"
Help.RegexPattern = ".+" 'require at least one character
Do While True
Wait For (NameDialog.ShowTemplate(Help, "OK", "", "CANCEL")) Complete (Result As Int)
Loop