0

I've got a code that starts intent to take picture from camera

Intent pictureActionIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(pictureActionIntent, PhotoUtility.CAMERA_PICTURE);

And after picture is taking back it should calls onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode != Activity.RESULT_OK)
        return;

    if (requestCode == PhotoUtility.CAMERA_PICTURE) {
        File f = PhotoUtility.saveFromCamera(data, picIV);
        imagePath = f.getAbsolutePath();
    } else if (requestCode == PhotoUtility.GALLERY_PICTURE) {
        File f = PhotoUtility.saveFromGallery(data, getActivity(), picIV);
        imagePath = f.getAbsolutePath();
    }
}

With simple Fragment it works fine, but if I use DialogFragment onActivityResult is not calling. How can solve this problem using DialogFragment?

  • Put complete code, including your dialog fragemet and fragment, have you implemented captrue image logic yourself, or are your using inbuilt apps for that?? – Techfist Sep 02 '14 at 13:11
  • Did you mean you are calling the intent from the dialog fragment and its not working? – Psypher Sep 02 '14 at 13:16
  • DialogFragment is no different than its base Fragnent class, it works exactly the same – pskink Sep 02 '14 at 13:35

0 Answers0