title: Taking picture from camera in android fragment is not working
body: <p>I am able to take picture from gallery but found problem in capture from camera in fragment.
  After picture taken onActivityResult is some times called and when called it gives some exception file not found.</p>
  
  <p>my code is </p>
  
  <pre><code>if (requestCode == CAMERA_REQUEST &amp;&amp; resultCode == getActivity().RESULT_OK) {
  if(flag==0){
      try{                   
         String URI = getImageURI();
         String imageName = URI.substring(URI.lastIndexOf("/")+1);
         FileInputStream fis = mContext.openFileInput(imageName);
         Bitmap photo = BitmapFactory.decodeStream(fis);
         Matrix matrix = new Matrix();
         matrix.preRotate(90);
         photo = Bitmap.createBitmap(photo , 0, 0, photo.getWidth(),    photo.getHeight(), matrix, true);
      }
      catch(Exception e){ 
              Log.e("Error - ",e.getMessage());
      }
     }
   }
  
   public void takePictureFromCamera(){
                File style = new File(Environment.getExternalStorageDirectory(),"style");
        if(!style.exists()){style.mkdir();}
          String d = System.currentTimeMillis()+"";
          File f = new File(style, d+"style.jpg");
          absPath = f.getAbsolutePath();
          savePref(absPath);
          cameraImagePath = Uri.fromFile(f);
          takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, cameraImagePath);
          }
          getActivity().startActivityForResult(takePictureIntent, CAMERA_REQUEST);
    }
  </code></pre>