how to use the service startAt service to display a message at a specific time?
if datetime.time = "08:00" then
msgbox ("message", "title")
end
thank you
instead of a message you can jump into a activity with StartActivity or CallSubDelayed
B4X:
Sub Activity_Create(FirstTime As Boolean)
Log("Activity_Create")
Dim p As Period
p.Seconds = 10
Dim time As Long = DateUtils.AddPeriod(DateTime.Now,P)
Log(time)
StartServiceAtExact(TestStartService,time,True)
Log("..")
B4X:
Sub Service_Start (StartingIntent As Intent)
Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
ToastMessageShow("HELLO",True)
End Sub
I have the following error messages:
-variable not declared "service" it is used before having assigned a value to it.
-variable not declared "teststartservice" it is used before having assigned a value to it.
thank you
i made a service TestStartService, there you find Service_Start event, see project/add new module/service module
and i started it from a activity in Activity_Create for testing
in your example "Dim p As Period
p.Seconds = 10
Dim time As Long = DateUtils.AddPeriod (DateTime.Now, P) "
I do not see the part about the time "08:00"