Android Question Disable notifications programmatically

Neojoy

Member
Licensed User
Hi, I would like to know if is possible disable notification from my app without open notification settings.

I'm using the code below to check if it is on or off, any idea?

B4X:
Sub AreNotificationsEnabled As Boolean
    Dim jo As JavaObject
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    jo = jo.InitializeStatic("android.support.v4.app.NotificationManagerCompat").RunMethod("from", Array(ctxt))
    Return jo.RunMethod("areNotificationsEnabled", Null)
End Sub
 

Neojoy

Member
Licensed User
My app record phone calls. When notifications settings is on and I make a phone call, a small icon and app name appears on notification bar on Android 8 and 9.

So I need to set notifications off to my app stay invisible.

How can I do this programmatically or using manifest file?
 
Top