System camera call method:
Step 1:
Intent bycamera = new intent ("android. Media. Action. image_capture"); bycamera. putextra (mediastore. extra_output, Uri. fromfile (yourfilepath); startactivityforresult (bycamera, 0 );
Step 2:
Obtain the returned data in the onactivityresult (INT, Int, intent) method of the current activity.
Protected void onactivityresult (INT requestcode, int resultcode, intent data) {If (requestcode = 0) {If (resultcode = result_ OK) {// print data here, data is null. That is to say, no data log is returned. I (TAG, "Data --->" + data);} else if (resultcode = result_canceled) {// user canceled the image capture} else {// image capture failed, advise user }}}
As in the code comments section, when printing data, the data is found to be empty and no data is returned for the purchase on behalf of the user. However, the path to the SD card shows that the image has been taken successfully .. At this point, the blogger did not find the reason ..
A friend who wishes to find the reason left a message to help answer the question.