jazzzzzzz Active Member Licensed User Longtime User Apr 15, 2018 #1 Code: Copy Dim n As Notification n.Initialize n.Icon = "icon" n.Vibrate = False n.Sound = False n.Light = False n.SetInfo("test", "Nothing to show",Main) Service.StartForeground(0,n) I need to make a NB6 notification which continuously change its content in every 3 seconds and is persistent like in above code..Any help?
Code: Copy Dim n As Notification n.Initialize n.Icon = "icon" n.Vibrate = False n.Sound = False n.Light = False n.SetInfo("test", "Nothing to show",Main) Service.StartForeground(0,n) I need to make a NB6 notification which continuously change its content in every 3 seconds and is persistent like in above code..Any help?
Peter Simpson Expert Licensed User Longtime User Apr 15, 2018 #2 Just select the nb6 notification that you want to use and restart the service every 3 seconds using StartServiceAtExact or you could try to keep the service alive with a partial lock and service foreground for sdk 26+. Search the forum for 'service foreground' Upvote 0
Just select the nb6 notification that you want to use and restart the service every 3 seconds using StartServiceAtExact or you could try to keep the service alive with a partial lock and service foreground for sdk 26+. Search the forum for 'service foreground'
jazzzzzzz Active Member Licensed User Longtime User Apr 15, 2018 #3 Peter Simpson said: Just select the nb6 notification that you want to use and restart the service every 3 seconds using StartServiceAtExact or you could try to keep the service alive with a partial lock and service foreground for sdk 26+. Search the forum for 'service foreground' Click to expand... still people can swipe and remove the notification right? I have seen some speed monitor apps which keeps on changing data with non removable notification..! I need a non removable b4a bridge notification with some live data change like time.!! Upvote 0
Peter Simpson said: Just select the nb6 notification that you want to use and restart the service every 3 seconds using StartServiceAtExact or you could try to keep the service alive with a partial lock and service foreground for sdk 26+. Search the forum for 'service foreground' Click to expand... still people can swipe and remove the notification right? I have seen some speed monitor apps which keeps on changing data with non removable notification..! I need a non removable b4a bridge notification with some live data change like time.!!
Peter Simpson Expert Licensed User Longtime User Apr 15, 2018 #4 Well you just said 'B4A Bridge', so here is the code for the bridge, Erel is good at uploading the lewest code https://www.b4x.com/android/forum/threads/b4a-bridge-source-code.8153/#content Upvote 0
Well you just said 'B4A Bridge', so here is the code for the bridge, Erel is good at uploading the lewest code https://www.b4x.com/android/forum/threads/b4a-bridge-source-code.8153/#content
jazzzzzzz Active Member Licensed User Longtime User Apr 15, 2018 #5 Thanks for that, Got some ideas and it worked Upvote 0
D designer2k2 Member Licensed User Longtime User May 16, 2018 #6 Hello, i needed the same, and worked it out! add this to your NB6: Code: Copy 'Sets the ongoing status of the notification, the user cannot close it. Public Sub setOngoing (ongoing As Boolean) As NB6 If IsOld Then OldNotification.OnGoingEvent = ongoing Else NotificationBuilder.RunMethod("setOngoing", Array(ongoing)) End If Return Me End Sub And where you setup the notification add: Code: Copy n.setOngoing(True) Upvote 0
Hello, i needed the same, and worked it out! add this to your NB6: Code: Copy 'Sets the ongoing status of the notification, the user cannot close it. Public Sub setOngoing (ongoing As Boolean) As NB6 If IsOld Then OldNotification.OnGoingEvent = ongoing Else NotificationBuilder.RunMethod("setOngoing", Array(ongoing)) End If Return Me End Sub And where you setup the notification add: Code: Copy n.setOngoing(True)