0

I am facing issue while taking image from camera and gallery to a fragment, my condition is

I have four fragments in view pager and one of the fragment is having profile pic update functionality, I am not getting the result in onActivityResult() of Parent Activity for some devices and that is why I am not getting the result for Fragment too, I am Using the below code, Please tell me what is going wrong "I am facing this issue mostly in SAMSUNG devices",

ON ACTIVITY RESULT FOR PARENT ACTIVITY,

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(fragmentProfile!=null)
        fragmentProfile.onActivityResult(requestCode,resultCode,data);
}

Intent in Fragment Profile for Capturing Photo

Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(cameraIntent, REQUEST_CODE_TAKE_PICTURE);
Cœur
  • 37,241
  • 25
  • 195
  • 267
Custadian
  • 845
  • 1
  • 11
  • 37
  • [Check](http://stackoverflow.com/questions/15248265/camera-intent-not-working-with-samsung-galaxy-s3/15287164#15287164) – Skynet Dec 17 '15 at 03:51
  • We have crop functionality too @Skynet; at that time when I am returning back after cropping, I am unable to get the onActivityResult() code. This all is happening in Fragment and Phone screen is also rotating. – Custadian Dec 17 '15 at 06:10
  • In that case, it would be better to implement your own camera. – Skynet Dec 17 '15 at 06:12
  • If you have any blog or suggestion that would be better; because we are on the verge so we don't have so much time. – Custadian Dec 17 '15 at 06:25
  • [Check](http://stackoverflow.com/questions/12273976/camera-tutorial-for-android-using-surfaceview) check each answer and the comments / links to tutorials therein. – Skynet Dec 17 '15 at 06:28
  • It's probably yet another manifestation of camera intent pushing your app out of memory, you should [save and restore the Activity state](http://stackoverflow.com/a/20433752/192373). – Alex Cohn Dec 17 '15 at 20:04

0 Answers0