I get a crashlytics in Android 8
Context.startForegroundService() did not then call Service.startForeground()
probably with this code:
I saw this tutorial from Erel:
https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content
but I don't know how I can change the code above correctly, with this lines:
I can insert this lines in any part of the code? Or before StopService? Or after StopService?
Thanks in advance for any tip.
(B4A = 8 / SDK Target = 21)
Context.startForegroundService() did not then call Service.startForeground()
probably with this code:
B4X:
'Alarm Service
Sub Service_Start (StartingIntent As Intent)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.Vibrate = False
n.SetInfo2("You get a new message!", "Click and check it!", "odNotify", Main)
n.Notify(1)
Dim t As Long
t = FindNextTime(Array As Double(8, 12, 18))
StartServiceAt(Me,t,True)
StopService(Me)
End Sub
I saw this tutorial from Erel:
https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content
but I don't know how I can change the code above correctly, with this lines:
B4X:
Sleep(0) 'allow the MessageReceived event to be raised.
Service.StopAutomaticForeground
Thanks in advance for any tip.
(B4A = 8 / SDK Target = 21)