ビットマップ画像 (bm) を jpeg に変換し、次を使用して電話の内部メモリに画像を保存しました。
ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, outputBuffer);
byte[] byteImage1=outputBuffer.toByteArray();
//save file to internal storage
FileOutputStream outputStream;
try {
outputStream = context.openFileOutput("myphoto.jpg", Context.MODE_PRIVATE);
outputStream.write(byteImage1);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
今、shareIntentを使用して保存された画像を共有したい
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpeg");
share.putExtra(Intent.EXTRA_STREAM,
Uri.parse(context.getFilesDir().getPath() + "myphoto.jpg"));
context.startActivity(Intent.createChooser(share, "Partager par"));
しかし、クリックボタンを押したときにインテントが実行されていません。この問題について助けを貸してください。