general settings should work, but you should use general default settings.
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences.Editor editor = preferences.edit(); editor.clear(); editor.commit();
To get general settings using a file name, Android creates that name (perhaps based on the package name of your project?). You can get it by putting the following code in ConfigurationActivity onCreate and looking at what preferencesName is.
String preferencesName = this.getPreferenceManager().getSharedPreferencesName();
The string should be something like "com.example.projectname_preferences". Hard code somewhere in your project and pass it to getSharedPreferences (), and you should be good to go.
AS:
PreferenceManager.getDefaultSharedPreferences(this);
Provides access to the settings file, which is global for the entire application package; any activity can access preferences (internaly, an xml file containing preferences will be called your.application.package_preferences.xml ).
getParent().getSharedPreferences("preference_settings", MODE_PRIVATE);
Provides preferences only for the contextInstance class: only instances of the context class can access these settings (said that your package is still your.application.package , and you are in your.application.package.SecondActivity , internaly is the SecondActivity.xml settings SecondActivity.xml ).
Nermeen
source share