boxme / SquareCamera

Android Camera Library For Square Photo Taking
MIT License
569 stars 189 forks source link

Question about integration. #20

Open helloerikaaa opened 9 years ago

helloerikaaa commented 9 years ago

Hi, I want to open another fragment after taking the picture. I've tried many, many ways and I can't do it yet. Can you help me with it? Also, if I try to do anything on the onActivityResult switch-case, I can't because it never gets to enter to the switch code.

Thanks!

GiacomoDB commented 9 years ago

You need to launch your fragment in the onPictureTaken method in the CameraFragment class:

@Override
public void onPictureTaken(byte[] data, Camera camera) 
{
    int rotation = getPhotoRotation();
    //Log.d(TAG, "normal orientation: " + orientation);
    //Log.d(TAG, "Rotate Picture by: " + rotation);
    getFragmentManager()
            .beginTransaction()
            .replace(
                    R.id.fragment_container,
                    EditSavePhotoFragment.newInstance(data, rotation, mImageParameters.createCopy()),
                    EditSavePhotoFragment.TAG)
            .addToBackStack(null)
            .commit();
    }

in this case EditSavePhotoFragment will start after the picture is taken