How to get default preferences

You can get the default preferences from your preferences.xml file by using the following code:

// Get the xml/preferences.xml preferences
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
String settingValue = preferences.getString("setting", "");

Leave a Reply

Your email address will not be published.