以下是原代码,为什么执行到红色部分就不往下执行呢,谢谢了?
try {
AssetManager a = null;
InputStream inputStream = a.open("**.**");
ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream();
byte[] bytes = new byte[1];
while(inputStream.read(bytes) != -1) {
arrayOutputStream.write(bytes);
}
arrayOutputStream.close();
inputStream.close();
} catch(IOException e){
System.out.println("文件有误Erroe");
}
------解决方案--------------------
需要正确初始化assetmanager
AssetManager a = getAssets();