Its simple Genius!
Your default sd card preference.xml file path might be: /data/data/your package name/shared_prefs/your shared preference xml file.
like, /data/data/com.hirecraft.hirecraftmanager/shared_prefs/swipe_preferences.xml.
delete preference xml file:
File deletePrefFile = new File("/data/data/com.hirecraft.hirecraftmanager/shared_prefs/swipe_preferences.xml");
deletePrefFile.delete();
Or get file path in String like,
String filePath = getApplicationContext().getFilesDir().getParent()+"/shared_prefs/swipe_preferences.xml";
File deletePrefFile = new File(filePath );
deletePrefFile.delete();
clear()
will clear out the file, but will not delete the file from the file system. A poorly designed app (like mine) could end up with many many empty files, taking up space. @kirill's & @inazaruk's method seems to work for me. – Giza