Notification problem with Delete or AutoCancel
Hi,
i've create a service (AlarmService) with:
notification is activated properly !!
1) Why clicking on the notification can not be erased automatically? (Notification1.AutoCancel =True)
2) if I try to manually delete it by ID, notification is NOT DELETED!!!
in Main:
Sub AlarmReset
Dim noti As Notification
noti.Cancel(1)
ToastMessageShow(trans.GetText("ALARM CANCELED") & " (ID: " & tmpAlertID & ")", False)
End Sub
thanks
Hi,
i've create a service (AlarmService) with:
B4X:
'---------------------------------------------------------
Sub Process_Globals
Dim AlarmID As Int
Dim DescriptionTitle As String
Dim DescriptionBody As String
Dim DoneSuccessfully As Boolean
Dim Notification1 As Notification
End Sub
Sub Service_Create
Notification1.Initialize
Notification1.Icon = "icon" 'use the application icon file for the notification
Notification1.Vibrate = True
Notification1.SetInfo(DescriptionTitle, DescriptionBody, "") ' Main)
Notification1.Sound = True
Notification1.AutoCancel =True
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StartForeground(1, Notification1)
End Sub
'----------------------------------
notification is activated properly !!
1) Why clicking on the notification can not be erased automatically? (Notification1.AutoCancel =True)
2) if I try to manually delete it by ID, notification is NOT DELETED!!!
in Main:
Sub AlarmReset
Dim noti As Notification
noti.Cancel(1)
ToastMessageShow(trans.GetText("ALARM CANCELED") & " (ID: " & tmpAlertID & ")", False)
End Sub
thanks
Last edited by a moderator: