I am using getPreferences()
method in different activities of my app. That means, Android create different files, one for each activity in which I am using that method.
I would like to clear all those files. Is there any way? Now, I delete every single file in the shared_prefs directory of the app, but I would like a more "safety" solution.
File folder = new File(getFilesDir() + File.separator + "shared_prefs" + File.separator);
if (folder.exists() && folder.isDirectory()) {
String[] children = folder.list();
for (int i = 0; i < children.length; i++)
new File(folder, children[i]).delete();
}