Android Question open a TimeDialog from a Dialog

Ferregato

New Member
Licensed User
hello, I am trying to open a TimeDialog from a Dialog, but but when the method called the 'show' the TimeDialog does not open.

code:

B4X:
Sub dialog
Dim DR As Int
   
    'Custom dialog
    Dim pnlBody As Panel
    pnlBody.Initialize("")
    pnlBody.LoadLayout("dialogProgramacao")
       
    Dim btnOK As Button
    btnOK.Initialize("")
    btnOK.Text = "Confirma"
    btnOK.TextColor = Colors.Black

    Dim btnCancel As Button
    btnCancel.Initialize("")
    btnCancel.Text = "Cancelar"
    btnCancel.TextColor = Colors.Black

    Dim dlgParams As BD_CustomDlgParams
    dlgParams.Initialize
    dlgParams.Title = "Programação da OS"
    dlgParams.TitleHeight = 56dip
    dlgParams.DialogBody = pnlBody
    dlgParams.BodyWidth = 360dip
    dlgParams.BodyHeight = 530dip
    dlgParams.PositiveButton = btnOK
    dlgParams.CancelButton = btnCancel

    DR = BD.CustomDialog(dlgParams, "CD1")


End Sub

Sub btnHoraPrevista_Click
    'muda a hora de previsao
    Dim hh As TimeDialog
    hh.TimeTicks=horaPrevisao '  horaEntrada
     Dim ret As Int
    hh.Is24Hours=True
    ret=hh.Show("Entre com a hora de previsão :","Previsão:","OK","","Cancelar",Null)
    If ret = -1 Then
        'horaEntrada=hh.TimeTicks
        horaPrevisao=hh.TimeTicks
        btnHoraPrevista.Text=DateTime.Time(horaPrevisao) 'DateTime.Time(horaEntrada)
        
    End If
End Sub



I am new to b4.
 
Top