Camera Intent returns null onActivityResult
<p>I am trying to take a photo and to save it to a custom location-</p>

<pre><code>public void SavePhoto(View view){

    Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());

    File imagesFolder = new File(Environment.getExternalStorageDirectory(), "WorkingWithPhotosApp");
    imagesFolder.mkdirs();

    File image = new File(imagesFolder, "QR_" + timeStamp + ".png");
    Uri uriSavedImage = Uri.fromFile(image);

    imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
    startActivityForResult(imageIntent, REQUEST_IMAGE_CAPTURE);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(data==null){
        Toast.makeText(MainActivity.this, "Data is null", Toast.LENGTH_SHORT).show();
    }
    else{
        if (requestCode == REQUEST_IMAGE_CAPTURE &amp;&amp; resultCode == RESULT_OK) {
            Bundle extras = data.getExtras();
            Bitmap imageBitmap = (Bitmap) extras.get("data");
            ImageView mImageView=(ImageView)findViewById(R.id.imageView);
            mImageView.setImageBitmap(imageBitmap);
        }
    }
}
</code></pre>

<p>data is null in onActivityResult(). What did I miss?</p>