ImageCapture uri
<p>I am trying to take the output of the captured image into a uri but it throws null pointer exception on another component which was not null before and when not storing the image in uri it runs okay</p>

<pre><code>Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
                    mImageCaptureUri1 = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
                            "Photo" + String.valueOf(System.currentTimeMillis()) + ".jpg"));                
                    cameraIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri1);                     
                    cameraIntent.putExtra("return-data", true);
                    startActivityForResult(cameraIntent, CAMERA_REQUEST);
</code></pre>

<p>and on activity result</p>

<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {     
        if (requestCode == CAMERA_REQUEST &amp;&amp; resultCode == RESULT_OK) {         

            Bitmap temp=null;
            Bundle extras = data.getExtras();
            /*Uri g=data.getData();
                try {
                    temp = MediaStore.Images.Media.getBitmap(getContentResolver(), g);
                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
             */
            if (extras != null) {               
                Bitmap photo = extras.getParcelable("data");                
                int h=photo.getHeight();
                int w=photo.getWidth();             
                /*   try {

                    temp = MediaStore.Images.Media.getBitmap(this.getContentResolver(), mImageCaptureUri1);
                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }*/

                try {
                    ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    photo.compress(Bitmap.CompressFormat.PNG, 100, stream);
                    bitmapdata = stream.toByteArray();
                    Log.i("image", ""+bitmapdata);
                    image_boolean=true;
                    stream.flush();
                    stream.close();
                    /*File f = new         File(mImageCaptureUri1.getPath());            
                    if (f.exists()) f.delete();*/

                }catch(Exception e)
                {}
                imageView.setImageBitmap(photo);
            }}

    }                    
</code></pre>
