Settings

A 3-post collection

This will demonstrate how to listen for changes to the user preferences in your app, so that you can perform tasks depending on what the user selected/changed on the preferences screen. I have an app, with a listfragment displaying rows of text. There is also a preferences screen (SettingsActivity.java) where users can set the sorting order of the list. When users change the sort order, the list should be refreshed, to disaply the items in the new order.

It is quite easy to have a preference item in your app to link to your website, or an app in Google Play. This does not even require any additional permissions for your app. However, it would be great to make sure the user knows what happens if the presses the preference item, for example if it will open a new page in the browser. To have a preference item open a website: Just add an intent inside your preference

If you are using Androids settings menu to provide your users with settings, you can set default values when the application is first started. The details are explained in further details in the “Defaults” section in the documentation. However, the short version is this: In your preferences.xml file, where you specify your different setting items, use the android:defaultValue attribute to specify the settings default value. <!-- default value is a boolean --> <CheckBoxPreference android:defaultValue=