StartServiceAt everyday


Well-Known Member
Licensed User
I rephrase my question differently.
My application needs to send a notification every day at the same time.
But it is the user of the application who must set the time of sending.
I code
In Main Module
"HeureAverto" is a long which represents the time chosen by the user
Sub ChkNotif_CheckedChange(Checked As Boolean)
If ChkNotif.Checked = True Then
    MyHeure = DateTime.Time(HeureAverto)
End If
End Sub

In Module Service
    Sub Service_Start (StartingIntent As Intent)

         Dim n As Notification
         n.Icon = "logo"
         n.SetInfo("Contraception", alerte, "Main") 
         n.Vibrate = True
   StartServiceAt("", DateTime.Now + 60000 * 60 *24, True) '24 hours after
End Sub

The problem is: If the user chooses the time of notification for 12 h00 (HeureAverto) but if he makes the setting at 17 hours, the service starts every day at 17 hours and not at 12 hours as it should.
This because, if this time chosen has already past the service will be started now.
Do you understand me?