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?
Choose a Notification of an App to Customize it If you already have notifications in the notification drawer then it will show up in the Notification list of the app. Tap on the notification to customize it. At the bottom, the customize button will pop-up.
java file to add Notification code. Modify layout XML file res/layout/activity_main. xml add any GUI component if required. Run the application and choose a running android device and install the application on it and verify the results.
Tap an app. Some devices may require you to tap the app name twice. Tap 'Notifications' or 'App notifications'. Tap 'On' or 'Off'.
App notificationsThe Apps notifications menu will list your installed apps. Tap on any app to change its notification settings. You can set it to block notifications from being generated by that app, or to flag this app's notifications as priority notifications.
For the first method, swipe down from the top of the screen (once or twice, depending on your device) and tap the gear icon to go to the Settings. Next, select “Apps & Notifications” or simply “Notifications.” Tap “See All [Number] Apps” or “App Settings.” Find the app that you would like to customize notifications and select it.
Some apps show a dot when you get notifications. Touch and hold the app with the dot to see the notification. To turn notification dots on or off for your device: Open your phone's Settings app. Tap Apps & notifications Notifications. Turn Allow notification dots on or off.
To pick specific categories of notifications, tap the app's name. Tip: If you don't see "Recently sent," you're using an older Android version. Instead, tap App notifications and tap an app. You can turn notifications, notification dots, and notification categories on or off. If an app has categories, you can tap a category for more options.
Reply, archive, expand & more To expand a notification, tap the Down arrow . Then, to act directly from a notification, tap an action, like Reply or Archive. Some apps show a dot when you get a notification. Touch and hold the app with the dot to see the oldest notification.
The following will work in Android 5.0 (Lollipop) and above:
Intent intent = new Intent(); intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //for Android 5-7 intent.putExtra("app_package", getPackageName()); intent.putExtra("app_uid", getApplicationInfo().uid); // for Android 8 and above intent.putExtra("android.provider.extra.APP_PACKAGE", getPackageName()); startActivity(intent);
Notes: This is not officially supported in Android 5-7, but it works just fine. It IS officially supported as of Android 8. This code is not backwards compatible with versions of Android before 5.0.
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