Quick Access to your Application Notification Settings

Android Lollipop is coming soon and brings a lot of improvements from a user perspective. One of the major visual enhancement is obviously Material Design. But Android Lollipop also includes richer and more interactive notifications.

Android has been providing notification settings for quite a long time now. These settings are available by long pressing a notification. Unfortunately, these settings were clearly suffering from a lack of controls as they were global to your application. Disabling notifications for a particular app was forcing the system not to display any of the following notifications (even Toasts…).

Starting Android Lollipop, the system UI gives a finer control over notifications. For instance, it is now possible to tweak how your app's notifications are shown based on their priority or how sensitive they are. But there is more! It is now possible to add a quick access button that brings users right to your application notification settings. This new quick access button (the "gear" icon is the screenshot below) is available just by long pressing a notification triggered by your app in the notification tray or right from the lock screen.

Implementing such a notification settings quick access inside your application is very easy and requires only a few lines of code in your AndroidManifest.xml. The trick consists on adding a new <intent-filter /> with the INTENT_CATEGORY_NOTIFICATION_PREFERENCES[0] category to your notification preferences Activity:


        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />


Adding this new <intent-filter /> to your application is fairly simple. I highly encourage you to do so as it can prevent your users from completely muting your notifications or even uninstall your application because they consider it as too noisy.

[0]: http://developer.android.com/reference/android/app/Notification.html#INTENT_CATEGORY_NOTIFICATION_PREFERENCES

#gde   #android   #article  
Shared publiclyView activity