Try ...
public class KITAppClass extends Application implements OnSharedPreferenceChangeListener { ... protected static SharedPreferences kitPrefs; ... }
Then open kitPrefs from the Activity (or other) classes in the application (if they occupy the same namespace), using, for example ...
KITAppClass.kitPrefs.getBoolean(...);
Saying that storing an instance of SharedPreferences at the Application class level is optional, as you can get SharedPreferences from any Activity at any time. See Using General Settings .
Also, think twice about actually expanding the Application if you really don't need to, and if you really don't know what you are doing with it. In most cases (for simple applications, at least) this is optional. Just because they show you how to do this in a book does not mean that you need to do this.
source share