public void onClick(View v)
{
try {
// Initiate ZipFile object with the path/name of the zip file.
ZipFile zipFile = new ZipFile("/sdcard/animation.zip");
// Extracts all files to the path specified
zipFile.extractAll("/sdcard/");
} catch (ZipException e) {
e.printStackTrace();
}
Toast.makeText(getApplicationContext(), "button clicked", Toast.LENGTH_LONG).show();
}
这就是我所做的。
我可以animation.zip
在 sdcard 上解压缩我的文件,但我想将它解压缩到 res/drawable-hdpi 文件夹中。