Thursday, April 16, 2015

Android Programmatically enable and Disable Notification Access

Android Programmatically Enable and Disable Notification Access

This post about how to disable and enable notification access service.

what is the NotificationListenerService?

To read all application notification

//Code

if (Settings.Secure.getString(this.getContentResolver(),"enabled_notification_listeners").contains(getApplicationContext().getPackageName()))
        {
         
      // Notification access service already enabled
 Intent intent = new Intent(
                        "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
                startActivity(intent);

        } else {
     //
  Enable to notification access service.

 Intent intent = new Intent(
                        "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
                startActivity(intent);
        }






Check out this may be help you

Related Posts Plugin for WordPress, Blogger...