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);
}
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);
}
No comments:
Post a Comment