This code
with definition of vars, are necessary put in all pages?
are there any thenic for put this code on in a MODULE or class.
y try to put somethin like this:
in a mod, but show a error:
static mod, no event detect (sorry, error showme in spanish)
B4X:
Sub btnDate_Click
'only CANCEL needed
Wait For (Dialog.ShowTemplate(DateTemplate, "", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
btnDate.xLBL.Text = DateTime.Date(DateTemplate.Date)
End If
End Sub
with definition of vars, are necessary put in all pages?
are there any thenic for put this code on in a MODULE or class.
y try to put somethin like this:
B4X:
Sub GetFechaDialogo(Act As Activity, TextoSolicitado As String ) As ResumableSub
Private Dialog As B4XDialog
Private DateTemplate As B4XDateTemplate
Dialog.Initialize ( Act)
Dialog.Title = "XUI Views"
DateTemplate.Initialize
DateTemplate.MinYear = 2016
DateTemplate.MaxYear = 2030
Dim RtFecha As String= ""
Dim td As DateDialog
'Msgbox(td.Version,"")
td.Year = DateTime.GetYear(DateTime.Now)
td.Month = DateTime.GetMonth(DateTime.Now)
td.DayOfMonth= DateTime.GetDayOfMonth(DateTime.Now)
'only CANCEL needed
Wait For (Dialog.ShowTemplate(DateTemplate, "", "", "CANCEL")) Complete (Result As Int)
If Result = Xui.DialogResponse_Positive Then
RtFecha = DateTime.Date(DateTemplate.Date)
End If
Return RtFecha
End Sub
in a mod, but show a error:
static mod, no event detect (sorry, error showme in spanish)