Private Sub CreateNotification(Message As String, Icon As String, TargetActivity As Object, Sound As Boolean, Vibrate As Boolean, Led As Boolean)
If (Message <> "") Or (Icon <> "") Then
Dim NewNotification As Notification
NewNotification.Initialize2(NewNotification.IMPORTANCE_HIGH)
NewNotification.Sound= Sound
NewNotification.Vibrate= Vibrate
NewNotification.Icon= Icon
If Led= True Then
Dim r As Reflector 'Reflection library
r.Target = NewNotification 'notification object
r.SetField("flags", Bit.Or(r.GetField("flags"), 1), "java.lang.int")
Else
NewNotification.Light= Led
End If
NewNotification.SetInfo(NameVersion, Message, TargetActivity)
NewNotification.Notify(NotificationID)
Service.StartForeground(NotificationID, NewNotification)
End If
End Sub