I am allowing the user to create multiple SharedPreferences files, but I also would like the option for them to delete these files. I know I could use internal
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
context.deleteSharedPreferences(preferencesKey);
} else {
try {
org.apache.commons.io.FileUtils.cleanDirectory(new File(context.getCacheDir().getParent() + "/shared_prefs/"));
} catch (IOException e) {
Log.e(TAG, "Cannot delete files in shared pref directory", e);
}
}