Move switch preference into its own demo.
This avoids everything breaking on pre-ICS platforms. Also get rid of pref initialization in Application. I hate that. Hate hate hate. Hate. Totally hate. Totally. Change-Id: Idb3526a96eb2dff49f9de8e5ae71149cb4ed6e96
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
package com.example.android.apis;
|
||||
|
||||
import android.app.Application;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
/**
|
||||
* This is an example of a {@link android.app.Application} class. Ordinarily you would use
|
||||
* a class like this as a central repository for information that might be shared between multiple
|
||||
* activities.
|
||||
* This is an example of a {@link android.app.Application} class. This can
|
||||
* be used as a central repository for per-process information about your app;
|
||||
* however it is recommended to use singletons for that instead rather than merge
|
||||
* all of these globals from across your application into one place here.
|
||||
*
|
||||
* In this case, we have not defined any specific work for this Application.
|
||||
*
|
||||
@@ -30,17 +30,7 @@ import android.preference.PreferenceManager;
|
||||
* of how to perform unit tests on an Application object.
|
||||
*/
|
||||
public class ApiDemosApplication extends Application {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
/*
|
||||
* This populates the default values from the preferences XML file. See
|
||||
* {@link DefaultValues} for more details.
|
||||
*/
|
||||
PreferenceManager.setDefaultValues(this, R.xml.default_values, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user