RTEditor/src/main/java/com/onegravity/rteditor/media/crop/CropImageActivity.java
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.rte_crop_image);
        mImageView = (CropImageView) findViewById(R.id.image);

        Intent intent = getIntent();
        Bundle extras = intent.getExtras();
        if (extras != null) {

            if (extras.getString(CIRCLE_CROP) != null) {
                mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
                mCircleCrop = true;
                mAspectX = 1;
                mAspectY = 1;
            }

            mImageSource = extras.getString(IMAGE_SOURCE_FILE);
            mBitmap = getBitmap(mImageSource);

            mImageDest = extras.getString(IMAGE_DESTINATION_FILE);
            if (mImageDest == null) {
                mImageDest = mImageSource;
            }
            mSaveUri = Uri.fromFile(new File(mImageDest));

            if (extras.containsKey(ASPECT_X)
                    && extras.get(ASPECT_X) instanceof Integer) {
                mAspectX = extras.getInt(ASPECT_X);
            } else {
                throw new IllegalArgumentException("aspect_x must be integer");
            }
            if (extras.containsKey(ASPECT_Y)
                    && extras.get(ASPECT_Y) instanceof Integer) {
                mAspectY = extras.getInt(ASPECT_Y);
            } else {
                throw new IllegalArgumentException("aspect_y must be integer");
            }
            mOutputX = extras.getInt(OUTPUT_X);
            mOutputY = extras.getInt(OUTPUT_Y);
            mScale = extras.getBoolean(SCALE, true);
            mScaleUp = extras.getBoolean(SCALE_UP_IF_NEEDED, true);
        }

        if (mBitmap == null) {
            finish();
            return;
        }

        startFaceDetection();
    }
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.rte_crop_image);
        mImageView = (CropImageView) findViewById(R.id.image);

        Intent intent = getIntent();
        Bundle extras = intent.getExtras();
        if (extras != null) {

            if (extras.getString(CIRCLE_CROP) != null) {
                mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
                mCircleCrop = true;
                mAspectX = 1;
                mAspectY = 1;
            }

            mImageSource = extras.getString(IMAGE_SOURCE_FILE);
            mBitmap = getBitmap(mImageSource);

            mImageDest = extras.getString(IMAGE_DESTINATION_FILE);
            if (mImageDest == null) {
                mImageDest = mImageSource;
            }
            mSaveUri = Uri.fromFile(new File(mImageDest));

            if (extras.containsKey(ASPECT_X)
                    && extras.get(ASPECT_X) instanceof Integer) {
                mAspectX = extras.getInt(ASPECT_X);
            } else {
                throw new IllegalArgumentException("aspect_x must be integer");
            }
            if (extras.containsKey(ASPECT_Y)
                    && extras.get(ASPECT_Y) instanceof Integer) {
                mAspectY = extras.getInt(ASPECT_Y);
            } else {
                throw new IllegalArgumentException("aspect_y must be integer");
            }
            mOutputX = extras.getInt(OUTPUT_X);
            mOutputY = extras.getInt(OUTPUT_Y);
            mScale = extras.getBoolean(SCALE, true);
            mScaleUp = extras.getBoolean(SCALE_UP_IF_NEEDED, true);
        }

        if (mBitmap == null) {
            finish();
            return;
        }

        startFaceDetection();
    }
****************************************** Lifecycle Methods *******************************************