Android Question StartServiceAt problem


Active Member
Licensed User

I now trie to use StartServiceAt by Erel's example (

Sub Service_Start (StartingIntent As Intent)
    StartServiceAt(Me, NextTimeInstance(17, 27) ,True)

End Sub

Sub NextTimeInstance (Hours As Int, Minutes As Int) As Long
    Dim today As Long = DateTime.Now
    today = DateUtils.SetDateAndTime(DateTime.GetYear(today), DateTime.GetMonth(today), _
     DateTime.GetDayOfMonth(today), Hours, Minutes, 0)
    If today < DateTime.Now Then
        Dim p As Period
        p.Days = 1
        Dim tomorrow As Long = DateUtils.AddPeriod(today, p)
        Return tomorrow
        Return today
    End If
End Sub

It worked(thank you), but when the app launched, a push notification is showed up, and it's unremovable, even if I close the app I can't hide the push notification from my notifications from my phone...

Does anybody know how can I fix this problem? (and how can I change the label of this notification - right now the label is "b4a example")

Thanks in advance...


Well-Known Member
Licensed User
Longtime User
i guess the notification comes because
DuringSleep True

if a foreground service is running non stop the notification is an indicator for end user.
the android activity windows are running only if u see it.
Upvote 0