我无法解压 SD 卡上的文件。我已经测试过 http://www.jondev.net/articles/Unzipping_Files_with_Android_%28Programmatically%29 How to unzip files programmatically in Android? Android - Unzip a folder?
它没有显示任何错误,没有警告,什么都没有,就像一切都很好。但 zip 文件未解压。
我启用了 WRITE_EXTERNAL_STORAGE_PERMISSION,因此我可以从应用程序写入 SD 卡(它有效,我测试过)
它可能是什么?
谢谢
最佳答案
尝试使用zip4j图书馆
使用 jondev 的解决方案,您必须注意文件路径:单个/省略可能会导致不起作用
编辑:根据评论,这可能可以帮助您:
String externalPath = getExternalFilesDir(null).getAbsolutePath();
Decompress d = new Decompress(externalPath + "/test.zip", externalPath + "/");
d.unzip();
关于java - 无法解压文件,测试了不同的功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8154424/