I was hoping to take a photo and enable only the camera app (or whatever
other app is bound to ACTION_IMAGE_CAPTURE) to store a photo in my content
provider.

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, MyPhotoStore.URI);

    // Grant permission to the camera activity to write the photo.
    intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
    intent.setData(MyPhotoStore.URI);

    startActivityForResult(intent, REQUEST_PHOTO);

Calling setData() on the URI enables the other app to write to the URI, but
it also messes up the activity dispatch (I get ActivityNotFoundException).

I'd rather not specify a package with Context.grantUriPermission() because I
want it to work for any activity bound to ACTION_IMAGE_CAPTURE.

Is there any way to use FLAG_GRANT_WRITE_URI_PERMISSION
with ACTION_IMAGE_CAPTURE?

I guess an alternative is to use random URIs instead of the built-in
security.

Thanks,
Bob

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to