【发布时间】:2013-05-15 14:11:44
【问题描述】:
我正在尝试分享图片和文字。 当我这样做时:
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/*");
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
screenshot.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
File f = new File(Environment.getExternalStorageDirectory()
+ File.separator + "temporary_file.jpg");
try {
f.createNewFile();
FileOutputStream fo = new FileOutputStream(f);
fo.write(bytes.toByteArray());
} catch (IOException e) {
e.printStackTrace();
}
share.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:///sdcard/temporary_file.jpg"));
share.putExtra(android.content.Intent.EXTRA_TEXT, textToShare);
startActivityForResult(Intent.createChooser(share, "Share Image"),
FROM_SHARE);
它适用于除 facebook 之外的所有应用程序(从 Gmail 等弹出对话框中选择),facebook 只接收图像而不接收文本。 有没有办法将带有图像的额外文本传递给 facebook 应用程序? 谢谢!
【问题讨论】:
-
this 你在找什么吗?
-
是的,但该解决方案对我不起作用...
标签: android facebook image text share