【发布时间】:2010-06-22 08:56:01
【问题描述】:
试试{
File f = new File("/data/cizip.zip");
if(f.exists()){
ZipFile zf = new ZipFile(f); //this always throws an error
/*some of my codes here*/
}
catch(IOException e){
AlertDialog.Builder abd = new AlertDialog.Builder(this);
abd.setMessage(e.getMessage());
abd.show();
}
ZipFile zf = new ZipFile(f); 行总是抛出错误,我不知道为什么。并且错误消息是文件名(“/data/cizip.zip”),因此我不知道错误的原因。有人可以告诉我是什么导致了这个错误吗?提前致谢。
【问题讨论】:
-
如果
getMessage()没有返回足够的信息,您可能需要更仔细地检查异常,例如printStackTrace()- 并检查 logcat。