February 2015
Intermediate to advanced
780 pages
19h 22m
English
<?xml version="1.0" encoding="utf-8"?><resources> <string-array name="selection_items"> <item>One</item> <item>Two</item> <item>Three</item> <item>Four</item> </string-array></resources>
Listing 5-34. Preferences Activity
//Note the package for this applicationpackage com.examples.sharepreferences;public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Load the preferences defaults on first run PreferenceManager.setDefaultValues(this, R.xml.preferences, false); addPreferencesFromResource(R.xml.preferences); }}
The settings values for this example application are manageable ...
Read now
Unlock full access