Why do I get null in data parmeter of onActivityResult

后端 未结 1 1450
南笙
南笙 2021-01-29 06:18

I use the following code to take picture from the android camera, after taking the pic onActivityResult is called with data parameter equals NULL.

Code -



        
相关标签:
1条回答
  • 2021-01-29 06:52

    Quoting the documentation for ACTION_IMAGE_CAPTURE:

    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.

    You provided EXTRA_OUTPUT. Your photo should be written to the location you provided in EXTRA_OUTPUT. Your data extra on the response should be null.

    0 讨论(0)
提交回复
热议问题