我有以下代码:
FileOutputStream out = null;
try {
out = new FileOutputStream("/sdcard/tmp/i.jpg");
b.compress(Bitmap.CompressFormat.JPEG, 90, out);
Toast.makeText(getApplicationContext(), "Succeded", Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Failed", Toast.LENGTH_LONG).show();
}
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpeg");
share.putExtra(Intent.EXTRA_STREAM, Uri.parse("/sdcard/tmp/i.jpg"));
startActivity(Intent.createChooser(share, "Share image"));
当它被调用时,一切正常。文件被保存并弹出选择器。但是一旦您进入您选择的活动,他们都会弹出一条消息,说我无法添加该图像。除了GMail,它工作正常。那么我到底该怎么做才能解决这个问题呢?