我发起一个活动来捕获照相机的图片:
I launch an activity to capture a picture from camera:
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);
i.putExtra("return-data", true);
startActivityForResult(i, PICK_FROM_CAMERA);
你能告诉我怎么去捕捉画面的URI?
Can you please tell me how to get the URI of the capture picture ?
要得到的是刚刚从相机,你会做的图像以下
To get the image that was just taken from the camera you would do the following
// 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);
}
}