Sub Process_Globals
Private xui As XUI
Public Start_Time As Long=10.00
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim nt As Long=setAlarm
StartServiceAt(EveryDay, nt, False)
End Sub
Sub setAlarm As Long
Dim t As Long=SetHours(Start_Time)
Log(t)
If t > DateTime.Now Then
Return t
End If
Return DateTime.Add(t, 0, 0, 1)
End Sub
Sub SetHours(st As Double) As Long
Dim hours As Int = Floor(st)
Dim minutes As Int = Round(60 * (st - hours))
Return DateUtils.SetDateAndTime(DateTime.GetYear(DateTime.Now), _
DateTime.GetMonth(DateTime.Now), DateTime.GetDayOfMonth(DateTime.Now), hours, minutes, 0)
End Sub