Android 4.1 offers the user a check box to disable notifications for a specific application.
However, as a developer we have no way to know whether a call to notify was effective or not.
I really need to check if the notifications are disabled for the current application but I can't find any setting for that in the API.
Is there ever a way to check this setting in the code?
Find and tap Settings > Apps. Tap All apps > Disabled.
Tap on the Apps & Notifications from the Settings. Select the Browser App (Say Chrome app) from the list of apps. Within Chrome App Info, tap on the Notifications tab. Here you will be able to see all the notifications currently enabled or disabled.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
You can't 100% can't.
It is asked in this Google I/O 2012 video and the Project lead for the new notifications declares that you can't.
2016 update: Now you can check it, as said in this Google I/O 2016 video.
Use NotificationManagerCompat.areNotificationsEnabled()
, from support library, to check if notifications are blocked on API 19+. The versions below API 19 will return true (notifications are enabled).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With