Android Error when rotating phone after taking picture using Intent ACTION_IMAGE_CAPTURE -
i error on activityresult:
"attempt invoke virtual method 'java.lang.string android.net.uri.getpath()' on null object reference",
when take picture rotate phone or emulator confirm "save" picture.
this how call camera:
file file = getoutputmediafile(processid); picuri = uri.fromfile(file); intent = new intent(android.provider.mediastore.action_image_capture); i.putextra(mediastore.extra_output, picuri); startactivityforresult(i, 1);
without seeing code onactivityresult(), can make experienced guess @ problem. there many different camera apps , don't behave same way.
typically, when request camera image capture , provide uri image extra_output, image written uri , no uri returned in result intent. suspect in onactivityresult(), expecting result intent contain uri. has none: resultintent.getdata() null.
if not provide uri image in request intent extra_output, result intent does contain uri, thumbnail size image.
Comments
Post a Comment