【发布时间】:2018-08-30 17:18:02
【问题描述】:
我正在处理位图保存到 android 中的应用程序文件夹 在牛轧糖下面它的工作正常,但在牛轧糖我有问题所以有人可以帮助我吗?
在我保存位图的代码下方
String getRoot = Environment.getExternalStorageDirectory().getAbsolutePath();
File myDir = new File(getRoot + "/" + folderNAme);
String fname = picName + format;
File file = new File(myDir, fname);
try {
FileOutputStream out = new FileOutputStream(file);
finalBitmap.compress(form, quality, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
Intent mediaScanIntent = new Intent(
Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
Uri contentUri = Uri.fromFile(file);
mediaScanIntent.setData(contentUri);
act.sendBroadcast(mediaScanIntent);
return file;
谢谢
【问题讨论】:
标签: android image bitmap gallery android-7.0-nougat