Unzip file from zip archive of multiple files using ZipFile class
问题 I'd like to use the ZipFile class to unzip a file using its name from an archive of multiple files. How can I get the string of the zip file name and directory to pass to the ZipFile constructor? 回答1: You can use the AssetManager and ZipInputStream http://developer.android.com/reference/android/content/res/AssetManager.html ZipInputStream in = null; try { final String zipPath = "data/sample.zip"; // Context.getAssets() in = new ZipInputStream(getAssets().open(zipPath)); for (ZipEntry entry =