Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a settings button in Android's app info page?

Nova Launcher opens their settings with the cogwheel in the upper right. How is this done? How would I place my app's settings activity there?

Nova settings button in System Settings -> Apps -> Nova Launcher

like image 355
aecl755 Avatar asked Jan 04 '23 22:01

aecl755


1 Answers

On Android 7.0 and higher, you can use this <intent-filter> on your settings activity:

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

The Settings app should pick that up and make it available to the user via that gear icon.

like image 136
CommonsWare Avatar answered Jan 17 '23 16:01

CommonsWare