I use this code below to notification and now I will update the app to SDK = 26.
The notification was works fine before, but now works only in Android 4, 4.4 and 7.0.
I tried with others codes from the forum and NB6 Class without success.
Any tip are welcome to solved this problem.
Thanks in advance.
Alarm Service:
Main module:
The notification was works fine before, but now works only in Android 4, 4.4 and 7.0.
I tried with others codes from the forum and NB6 Class without success.
Any tip are welcome to solved this problem.
Thanks in advance.
Alarm Service:
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.SetInfo2("Title", "Content", "odNotify", Main)
n.Notify(1)
Dim t As Long
t = FindNextTime(Array As Double(10, 18, 22)
StartServiceAt(Me,t,True)
StopService("")
End Sub
Main module:
B4X:
Sub StartNotification
Dim t As Long
t = FindNextTime(Array As Double(10, 18, 22)
Starter.manager.SetBoolean("alarm", True)
CancelScheduledService(Alarm)
StartServiceAt(Alarm,t,True)
End Sub