Android Shared Preference Still visible after Deleting File -
i trying application using shared preference. when delete preference file data/data/com.your.package.name/shared_prefs/mysharedpref.xml manually using android monitor, still app able read preference values.
i assuming how value retained in main memory of phone. correct & viable solution clear shared preferences totally leaving no traces. 1 thing want clear preference if file wiped. for need check presence of file, other approach rather checking file class ?
i think code must work
public static void clearallpreference(context context){ sharedpreferences prefs = context.getsharedpreferences(pref_file, context.mode_private); sharedpreferences.editor editor = prefs.edit(); editor.clear(); editor.commit(); }
Comments
Post a Comment