Mohamed Hafez Mohamed Hafez - 1 month ago 22
Android Question

Any way to link to the Android notification settings for my app?

Is there any way I can launch an intent to get to Android's notification settings screen for my app (pictured below)? Or an easy way I can make a PreferenceScreen item that just leads here on a click?

enter image description here

Answer

Try this:

Intent intent = new Intent();
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
intent.putExtra("app_package", getPackageName());
intent.putExtra("app_uid", getApplicationInfo().uid);
startActivity(intent);

It works in Lollipop.

Edit

Thank @codingjeremy for the suggestion to set intent's action rather than className.