Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 984
Mohamed Hafez Avatar asked Sep 03 '15 03:09

Mohamed Hafez


People also ask

How do I customize my app notifications?

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.

How do I integrate notifications on Android?

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.

How do I add notifications to my apps?

Tap an app. Some devices may require you to tap the app name twice. Tap 'Notifications' or 'App notifications'. Tap 'On' or 'Off'.

What is app management notification?

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.

How do I change the notification settings on my Android phone?

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.

How do I turn Notification Dots on or off on Android?

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.

How do I pick specific categories of notifications on Android?

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.

How do I archive notifications on my Android phone?

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.


1 Answers

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.

like image 159
shhp Avatar answered Sep 19 '22 13:09

shhp