How to open an image in Android with when I have the uri?
From my activity I open a Camera activity, take a picture and pass the uri back to my activity. Now I would like to just view the picture when I click on a button e.g. "result". This is wh开发者_JS百科at I do:
CameraActivity:
@Override
public void onPictureTaken(byte[] arg0, Camera arg1) {
Uri uriTarget = getContentResolver().insert(
Media.EXTERNAL_CONTENT_URI,
new ContentValues());
my mainActivity:
Intent pictureIntent = new Intent();
pictureIntent.setAction(Intent.ACTION_VIEW);
pictureIntent.setData(task.getUri());
startActivityForResult(pictureIntent, PIC_REQ);
but I get the error:
05-05 00:17:41.800: ERROR/AndroidRuntime(748): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CHOOSER dat=content://media/external/images/media/9 }
I've searched already a lot and I only found how to pick a picture from the gallery, but that's not what I want.
Anybody knows what I'm doing wrong?
Thanks
Johannes
精彩评论