Get image Uri in onActivityResult after taking photo?

后端 未结 4 728
逝去的感伤
逝去的感伤 2021-02-07 00:48

I have this code:

startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), CAMERA_IMAGE);

That allows that user to take a photo. Now

4条回答
  •  迷失自我
    2021-02-07 01:21

    protected void onActivityResult(int requestCode, int resultCode, Intent intent){
        Uri u = intent.getData();
    }
    

    By the way... there's a bug with that intent in some devices. Take a look at this answer to know how to workaround it.

提交回复
热议问题