Rentsch Daniel
Lurker
Hi,
i try to find out if on android chrome browser notifications are enabled.
My code here:
public boolean isPush() {
This works fine, the only problem is that areNotificationsEnabled() returns always true even when in the settings notifications are disabled.
What i'm doing wrong?
Thanks
i try to find out if on android chrome browser notifications are enabled.
My code here:
public boolean isPush() {
try {
catch (Exception e) {
}boolean OK;
OK = false;
Context context = getApplicationContext();
OK = NotificationManagerCompat.from(context).areNotificationsEnabled();
return OK;
}OK = false;
Context context = getApplicationContext();
OK = NotificationManagerCompat.from(context).areNotificationsEnabled();
return OK;
catch (Exception e) {
// This will catch any exception, because they are all descended from Exception
System.out.println("Error " + e.getMessage());
msg = e.getMessage();
return false;
}System.out.println("Error " + e.getMessage());
msg = e.getMessage();
return false;
This works fine, the only problem is that areNotificationsEnabled() returns always true even when in the settings notifications are disabled.
What i'm doing wrong?
Thanks