Hi 
 TreKing,

Thanks for the reply. You are absolutely right, it was my mistake. 

My requirement is to delete saved data of one application from another 
application( e.g I am launching *App B* from *App A*. In *App B*, I am 
saving the state of checkBoxPreference. I need to clear the state of that 
checkBoxPreference from *App A*. ) 

By observing different posts on forums, it looks like that it is not 
possible with SharedPreferences. Can you suggest any way do it?

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