android - onActivityResult returns null data for an Image Capture -


@override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      filepath = getoutputmediafile(filecolumns.media_type_image);     file file = new file(filepath);     uri output = uri.fromfile(file);     intent = new intent(android.provider.mediastore.action_image_capture);     i.putextra(mediastore.extra_output, output);     startactivityforresult(i, return_file_path); }      @override protected void onactivityresult(int requestcode, int resultcode, intent data) {     super.onactivityresult(requestcode, resultcode, data);      //data null here.     //requestcode = return_file_path;     //resultcode = activity.result_ok; } 

i checked values file , output uri, both fine , captured image exists @ location.

but data returned in onactivityresult null after capturing image.

edit:

i checked question:

onactivityresult returns data = null

which says:

whenever save image passing extraoutput camera intent data parameter inside onactivityresult return null. so, instead of using data retrieve image , use filepath retrieve bitmap.

and maybe solution work me. above code of mine working code until same scenario.

according post data null when pre insert uri. means defined output uri here:

  i.putextra(mediastore.extra_output, output); 

so when activity.result_ok; load taken photo known url.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -