こんにちは、
アクティビティ A と B の 2 つのアクティビティがあります。アクティビティ AI には Google マップとボタンがあります。ボタンで写真を撮ることができます。写真を撮った後、編集してタイトルなどを付けることができるアクティビティ B でそれが必要です。
これが私の活動方法です ボタンをクリックして写真を撮ります
private void onTakeFoto() {
Intent fotoIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(fotoIntent, CAMERA_RESULT);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == CAMERA_RESULT) {
Intent intentB = new Intent(this, B.class);
startActivityForResult(intentB , CAMERA_RESULT);
}
}
アクティビティ BI には、imageView と EditText があります。キャプチャした画像をアクティビティ B の imageView に表示したいのですが、どうすればよいですか? 誰かが私にそのヒントを教えてもらえますか?
ありがとう
私の onActivityResult には、次のコードがあります。
String res = null;
String[] proj = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, proj, null, null, null);
if (cursor.moveToLast()) {
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
res = cursor.getString(column_index);
cursor.close();
Bitmap bitMap = BitmapFactory.decodeFile(res);
m_currentImage.setImageBitmap(bitMap);
}
私が言ったように、キャプチャされたものではなく、他の画像を取得しました。誰かが間違いを教えてもらえますか?