MediaStore insert bitmap为黑色

MediaStore.Images.Media.insertImage(mFragmentActivity.getContentResolver(), qrBitmap, "xx券面值10元", "我是小钱生成");
mFragmentActivity.sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));

保存的图片是黑色的,不知道为嘛。

private void saveImage(final Bitmap bitmap) {
new Thread(new Runnable() {
@Override
public void run() {
try {
FileOutputStream m_fileOutPutStream = new FileOutputStream(
"/mnt/sdcard/DCIM/Camera" + File.separator + "filesave.png");
bitmap.compress(CompressFormat.PNG, 100, m_fileOutPutStream);
m_fileOutPutStream.flush();
m_fileOutPutStream.close();
System.out.println("保存完成");
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();

原文地址:https://www.cnblogs.com/anee/p/3628904.html