I just want to start the service from the activity that will show a notification after 24 hours when the user exits the app and a day has passed. When the service runs the code the service will stop (since it is started again from a button in the activity) The service will just need to act as a simple reminder showing a notification message. It is important that the notification (or other code) does not start directly. That's why it seems confusing to use StartService(TmrService) in the activity to start the service directly (which should run later!!). So to sum things up I appreciate you other programmers fill me in on this. Thanks.
Service_Start
hour and minute are global variables
' Here we start the service at a specific hour and minute value
StartServiceAt(Me, DateTime.Add(DateTime.Now, hour, minute, 1), True)
' Code that will run because of the scheduled service
If StartingIntent.HasExtra("android.intent.extra.ALARM_COUNT") Then
' Shows notification message
ShowNotification
end if
end sub
Sub ShowNotification
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.Sound = False
n.Vibrate = True
n.SetInfo("appname", "message goes here", Main)
n.Notify(1)
End Sub