0
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 文件夹中。

4

1 回答 1

0

您永远无法将 zip 文件解压缩到 res 文件夹。在移动设备中,您可以将其解压缩到 SD 卡或数据/数据文件夹中。我认为您想以这种方式更改应用程序的皮肤,但这是不可能的。如果您想更改皮肤,请按照此Android 添加额外皮肤作为单独的 APK

于 2014-11-22T06:26:50.273 回答