Call the Android camera execution result without callback Onactivityresult ()

Source: Internet
Author: User

============ Problem Description ============


I call the camera of the Android system:
Uri uri = uri.fromfile (new File (ImagePath));

Intent Intent = new Intent (mediastore.action_image_capture);

Intent.putextra (Mediastore.extra_output, URI);

Mactivity.startactivityforresult (intent,2);

The system camera is turned on, and the Onactivityresult (int requestcode, int resultcode,intent data) method is rewritten.
@Override
public void Onactivityresult (int requestcode, int resultcode,intent data) {
Super.onactivityresult (Requestcode, ResultCode, data);
if (Requestcode = = 2 && ResultCode = = RESULT_OK)
{
Cameraview.iview.setImageURI (Uri.fromfile (New File (Cameraview.imagepath)));

Bitmap bmp = (Bitmap) Data.getextras (). Get ("data");
LOG.D ("Test", "bmp width" + bmp.getwidth () + ", Height:" + bmp.getheight ());
}
}

After I take a photo, click the Confirm button and nothing happens. Click the Cancel button to callback the Onactivityresult method.

Please teach the great God, why click "Confirm" no callback Onactivityresult method????

============ Solution 1============


http://blog.csdn.net/shen332401890/article/details/9313379
Please refer to

In addition, what is the launchmode of your application? Default?

Besides, try the upstairs statement without judging the conditions.

Call the Android camera execution result without callback Onactivityresult ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.