activity does not close after taking picture Android
<p>Hi i have used SurfaceView and taking picture by below code</p>

<p>First i am starting activity by this code</p>

<pre><code>     startActivityForResult(new Intent(PictureEditor.this, CustomCamera.class), CAMERA_REQUEST3);
</code></pre>

<p>and then getting result from this code </p>

<pre><code>    @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_OK) {
        if (requestCode == CAMERA_REQUEST3) {
            BitmapFactory.Options abc = new BitmapFactory.Options();
            abc.inJustDecodeBounds = true;
            BitmapFactory.decodeFile((Environment.getExternalStorageDirectory() + File.separator + "tester.png"), abc);
            abc.inSampleSize = calculateInSampleSize(abc, w, h) + 1;
            abc.inJustDecodeBounds = false;
            view.setBackBitmap(BitmapFactory.decodeFile((Environment.getExternalStorageDirectory() + File.separator + "tester.png"), abc));

        }
</code></pre>

<p>Now the CustomeCamera Class's code is below</p>

<pre><code>          // / Handles when mTakePicture is clicked
private OnClickListener mTakePictureAction = new OnClickListener() {
    @Override
    public void onClick(View v) {
        if (mCamera != null)
            mCamera.takePicture(CustomCamera.this);


    }
};
</code></pre>

<p>Then </p>

<pre><code>        @Override
    public void takePicture(Activity activity) {
        if (mCamera != null)
            mCamera.takePicture(shutterCallback, rawCallback, jpegCallback);
        Intent returnIntent = new Intent();
        activity.setResult(mActivity.RESULT_OK, returnIntent);
        activity.finish();
    }
</code></pre>

<p>the problem is image is captured but the activity is not getting finish! Can anybody suggest me what to do!</p>
