I’m trying to follow the Material Design Guidelines on how to “Link your app’s settings to Android channel settings”. As the images shows, there should be a button on the app-settings “Additional settings in the app” but I don’t know how to set this up.
I’d expect the
NotificationChannel to have an option to set the correct intent or an intent-filter but I cannot find any option for that.
There has been similar behaviors for managing the network and I thought this would work the same way?!
Does anyone knows how to implement this?
You just need to add the following intent filter to your settings activity in the manifest:
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" /> </intent-filter>
This intent was added in API 21. It added a cog icon to the app’s notification page in the system settings. Clicking on the icon would take the user to the app’s settings activity.
The only change in Api 26 is that now it appears as ‘Additional settings in the app’ instead of an icon.
in case you want to open settings fragment just check intent of your activity: