Toast.makeText(MainActivity.this, “解析二维码失败”, Toast.LENGTH_LONG).show();
}
});
} catch (Exception e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
});
工具方法1:
======
private void saveFile(Bitmap bm, String fileName) throws IOException {
String subForder = SAVE_REAL_PATH;
File foder = new File(subForder);
if (!foder.exists()) foder.mkdirs();
File myCaptureFile = new File(subForder, fileName);
Log.e(“lgq”, “图片保持。。。。wwww。。。。” + myCaptureFile);
ends = myCaptureFile.getPath();
if (!myCaptureFile.exists()) myCaptureFile.createNewFile();
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(myCaptureFile));
bm.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.fl