Hi Amey,

Thanks for the reply. I have tried but it is not working.

I am unable to delete .bak file of the 
sharedpreferences(profile_preference) of application having package 
"com.android.blesettings". I have tried the following code:

                     File file = new 
File("/data/data/com.android.blesettings/shared_prefs/profile_preference.xml.bak");
                     file.delete();
 But still .bak file is present and data is retrieved from it. I am trying 
to clear the preferences of application having package 
"com.android.blesettings" from Settings(default) application of ICS source.

On Friday, 7 September 2012 16:31:37 UTC+5:30, Abhishek Kumar Gupta wrote:
>
> I want to remove(clear) the sharedpreferences of one application from 
> other application. I have tried the following code in the other application 
> to remove preferences of application having package 
> "com.android.blesettings":
>
>                     Context context = getActivity().createPackageContext(
>                             "com.android.blesettings", 0);
>                     SharedPreferences mSettings = 
> mSettingsContext.getSharedPreferences(
>                             "profile_preference", MODE_WORLD_READABLE);
>                     SharedPreferences.Editor mSettingsEditor = 
> mBLESettings.edit();
>                     mSettingsEditor.remove("proximity_settings");
>                     mSettingsEditor.commit();
>
> I am able to remove(clear) the value of the sharedpreference of 
> application(that I have observed by looking the "profile_settings" file) 
> but it is taking value(previously saved) from the *.bak* file of the 
> sharedpreferences.
>
> How to resolve this issue? Any help or guidance will be well appreciated.  
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to