Private edt As EditText
Private InputTemplate As B4XInputTemplate 'need XUI Views Lib
Private XUI As XUI 'need XUI lib
Private Dialog As B4XDialog
Private Base As B4XView
InputTemplate.Initialize
Base = Activity
Dialog.Initialize (Base)
InputTemplate.lblTitle.Text = "Enter time (HHHH:MM)" 'any number of hours
InputTemplate.RegexPattern = "([0-9]+):[0-5][0-9]$"
Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
edt.Text = InputTemplate.Text
End If