We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I've been reading about file deletion and I am aware that you need to call close() on a stream before deleting it. However I cannot call close() on a JSONObject and therefore I cannot delete the .json file by declaring a File object and calling File.delete() (it returns false). I tried setting the JSONObject to null and call System.gc(); before deleting but to no avail.
Answers
You can try but I didn't test myself:
I did that as well, forgot to mention it. Will edit my post.
I have :
boolean isDir = f.isDirectory(); if (isDir) { scenes = loadJSONArray("scenes.json"); } else { f.delete(); }