Helo,
I have two activities A and B. in activity A I have a google map and a button. The button allow me to take a picture. after taking picture I want it in activity B where I can edit it and give title and so on.
this is my method in activity A wenn I click a button to take a picture
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);
}
}
in activity B I have an imageView and EditText. I want to show the captured image in the imageView in activty B. How can I do it? can someone give me a tip for that?
thanks
in my onActivityResult I now have this code:
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);
}
As I said I got other Image and not the captured one. Can sombody tell me where is the mistake?