Delete file from internal storage

前端 未结 8 1655
借酒劲吻你
借酒劲吻你 2020-11-30 00:28

I\'m trying to delete images stored in internal storage. I\'ve come up with this so far:

File dir = getFilesDir();
File file = new File(dir, id+\".jpg\");
bo         


        
8条回答
  •  臣服心动
    2020-11-30 00:51

    Have you tried getFilesDir().getAbsolutePath()?

    Seems you fixed your problem by initializing the File object with a full path. I believe this would also do the trick.

提交回复
热议问题