Sub Globals
Private Dialog As B4XDialog 'need XUI Views 2.30 checked (internal lib)
Private DateTemplate As B4XDateTemplate
Private XUI As XUI 'you declare this if you use the XUI colors
Private lbl As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
lbl.Initialize("lbl")
Activity.AddView(lbl,300dip,0,150dip,75dip) 'via code, but you can do it via designer
lbl.Color=XUI.Color_Blue
Dialog.Initialize (Activity)
Dialog.Title = "Select a date"
DateTemplate.Initialize
DateTemplate.MinYear = 2016
DateTemplate.MaxYear = 2030
Wait For (Dialog.ShowTemplate(DateTemplate, "", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
Log($"Selected Date is: ${DateTime.Date(DateTemplate.Date}"$ ))
lbl.Text=DateTime.Date(DateTemplate.Date)
lbl.TextColor =XUI.Color_Yellow
End If
End Sub