开发者

Android+Java:File deletion error

开发者 https://www.devze.com 2023-02-14 15:19 出处:网络
hi i \'ve followin开发者_StackOverflowg code. and i want to delete a zip folder from a particular path

hi i 've followin开发者_StackOverflowg code. and i want to delete a zip folder from a particular path


   File file = new File("/mibook/"+mFilename+"/"+mZipname.toString());
   boolean deleted = file.delete();
   

but it returns False. why? TIA

edit:

For file also this code not working

 file = new File("/mibook/"+mFilename+"/iphone_settings.css");


You can't delete folders that still have content in it that way. The documentation says: "Directories must be empty before they will be deleted." Try to delete it recursively.

0

精彩评论

暂无评论...
验证码 换一张
取 消