Android preferences - what is the difference?
问题 What is the difference, when I get preferences as: PreferenceManager.getDefaultSharedPreferences(getBaseContext()); and getPreferences(Context.MODE_PRIVATE); 回答1: PreferenceManager.getDefaultSharedPreferences(getBaseContext()); Will provide an access to a preferences file that is global for the whole application package ; any activity can access the preferences (internaly, the xml file holding the preferences will be named your.application.package_preferences.xml ). contextInstance