Android Question B4XDateTemplate without keyboard

Arquero

New Member
Hello,

I'm showing a date pick dialog this way:

B4X:
...
dialog.Initialize(Activity)
dialog.Title = "Fecha del gasto"
dialog.PutAtTop = True       
Dim input As B4XDateTemplate
input.Initialize
input.FirstDay = 1
Wait For (dialog.ShowTemplate(input, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
...

The dialog is displayed properly on the upper section of screen, but is there any way to do not show soft keyboard at all? in this kind of dialog is completely useless...

Thanks in advance
 

Arquero

New Member
Nevermind, my fault.

The keyboard is displayed because I show the dialog when user clicks on EditText field, and is that EditText field who shows dialog, not the routine above.

B4X:
Private Sub ETFecha_FocusChanged (HasFocus As Boolean)
    If HasFocus Then
        dialog.Initialize(Activity)
        dialog.Title = "Fecha del gasto"
        dialog.PutAtTop = True       
        Dim input As B4XDateTemplate
        input.Initialize
        input.FirstDay = 1
        Wait For (dialog.ShowTemplate(input, "OK", "", "CANCEL")) Complete (Result As Int)
        If Result = xui.DialogResponse_Positive Then
            Dim res As String = input.Date
            Log(DateTime.Date(res))
        End If
    End If
End Sub

Just tried to show the dialog via button click and keyboard is not showed. So I'll remove dialog.PutAtTop for a centered dialog and EditText for a label or another view.

Thanks anyway
 
Upvote 0
Top