Marin Mitreff
Marin Mitreff

Reputation: 11

Android take picture and get path?

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);  
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

...

protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
    if (requestCode == CAMERA_PIC_REQUEST) {  
        Bitmap thumbnail = (Bitmap) data.getExtras().get("data");  
        ImageView image = (ImageView) findViewById(R.id.photoResultView);  
        image.setImageBitmap(thumbnail);  
    }  

How to get image's path to string?

Upvotes: 1

Views: 3712

Answers (1)

Michael
Michael

Reputation: 54705

As it's said in the docs:

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.

Upvotes: 7

Related Questions