我想使用任何适用的应用程序(例如Instagram)共享图像。 但是,以下代码返回"无法加载图像"
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
sendIntent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
if (curJoke.getImgUrl() != null) {
ParseFile file = curJoke.getParseFile(ParseConstants.IMAGE_COLUMN);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file.getUrl()));
sendIntent.setType("image/*");
}
sendIntent.putExtra(Intent.EXTRA_SUBJECT,
"share an joke");
startActivity(sendIntent);