Dim ntf As NotificationBuilder
Dim bv As Notification
ntf.Initialize
ntf.SmallIcon = "icon"
ntf.Ticker = "test"
ntf.DefaultLight = True
ntf.DefaultVibrate = True
Dim Sound As Boolean = True
ntf.DefaultSound = Sound
ntf.ContentTitle = "app"
ntf.ContentText = "test"
ntf.SubText = "Text"
ntf.setActivity(chat)
ntf.AutoCancel=True
ntf.OnGoingEvent=False
Dim p As Phone
If p.SdkVersion >= 26 Then
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim manager As JavaObject
manager.InitializeStatic("android.app.NotificationManager")
Dim Channel As JavaObject
Dim importance As String
If Sound Then importance = "IMPORTANCE_DEFAULT" Else importance = "IMPORTANCE_LOW"
Dim ChannelVisibleName As String = Application.LabelName
Channel.InitializeNewInstance("android.app.NotificationChannel", _
Array("MyChannelId1", ChannelVisibleName, manager.GetField(importance)))
manager = ctxt.RunMethod("getSystemService", Array("notification"))
manager.RunMethod("createNotificationChannel", Array(Channel))
Dim jo As JavaObject = ntf
jo.RunMethod("setChannelId", Array("MyChannelId1"))
End If
bv.Initialize
bv=ntf.GetNotification
bv.Notify(2)