FileDocCategorySizeDatePackage
DefaultValues.javaAPI DocAndroid 1.5 API2017Wed May 06 22:41:08 BST 2009com.example.android.apis.app

DefaultValues

public class DefaultValues extends android.preference.PreferenceActivity
This activity is an example of a simple settings screen that has default values.

In order for the default values to be populated into the {@link SharedPreferences} (from the preferences XML file), the client must call {@link PreferenceManager#setDefaultValues(android.content.Context, int, boolean)}.

This should be called early, typically when the application is first created. This ensures any of the application's activities, services, etc. will have the default values present, even if the user has not wandered into the application's settings. For ApiDemos, this is {@link ApiDemosApplication}, and you can find the call to {@link PreferenceManager#setDefaultValues(android.content.Context, int, boolean)} in its {@link ApiDemosApplication#onCreate() onCreate}.

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        
        addPreferencesFromResource(R.xml.default_values);