画像とテキストを共有しようとしています。私がこれをしているとき:
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アプリに画像付きの余分なテキストを渡す方法はありますか? ありがとう!