Add settings button to application information screen

With Android N, you can add the settings button to the application information screen, as in the figure below, but I can not find any information on how to implement this?

enter image description here

I think we only need to specify an intent filter for Activity, but which one should we use?

+4
source share
2 answers

You can use this on Android 7.0 and above by simply adding this line of code to your manifest:

<intent-filter>
  <action android:name="android.intent.action.APPLICATION_PREFERENCES" />
  <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+4
source

In Android 7.0 and above, you can use this <intent-filter>in your settings:

<intent-filter>
  <action android:name="android.intent.action.APPLICATION_PREFERENCES" />
  <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

The settings application should select this and make it available to the user through the icon of this gear.

0
source

Source: https://habr.com/ru/post/1686634/


All Articles