Вопрос по android, java – Как получить URL захваченного изображения?
но считаю, что вам нужно добавить дополнительную информацию в Intent. Документация ACTION_IMAGE_CAPTURE гласит:
The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT.
Итак, я думаю, вы должны добавить в эту строку:
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File ("MyImageCapture")));
И тогда вы сможете получить его из URI в onActivityResult.
Но я не проверял это. Надеюсь, я не сбил вас с пути.
которое было только что снято с камеры, вы должны сделать следующее
// Call to take the picture
startActivityForResult(new Intent("android.media.action.IMAGE_CAPTURE"), PICK_FROM_CAMERA);
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == PICK_FROM_CAMERA)
{
Uri uri = data.getData();
// set the imageview image via uri
_previewImage.setImageURI(uri);
}
}