Sub Service_Create
Service.AutomaticForegroundMode=Service.AUTOMATIC_FOREGROUND_ALWAYS '26+
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim sec As Long = 1800
Dim dnext As Long = DateTime.Now + (sec * DateTime.TicksPerSecond) ' prossima chiamata
StartServiceAt(Me, dnext, True) 'schedule
If StartingIntent.IsInitialized=True Then
' do something
Try
If StartingIntent.HasExtra("android.intent.extra.ALARM_COUNT") Then
Service.StopAutomaticForeground ' <--------- HERE!!???
' Do something , it takes a while
End If
Catch
End Try
End If
Sleep(0)
Service.StopAutomaticForeground ' da Android target +26
End Sub