当我尝试从位于 SDCard 中的文件中读取内容时,我使用了 FileInputStream 类,代码如下: 代码:
filepath = "/sdcard/myfile/testFile" FileInputStream fileIn = null;
fileIn = new FileInputStream(filepath); 字节 [] InBuf = 新字节 [1024];
fileIn.read(InBuf); Strubg fileContent = new String(InBuf);
fileIn.close();
当我运行我的程序时,android一直在我的最后一行报告空指针错误:“fileIn.close”,我真的不知道原因