title: How can I save temporary pictures with camera in Android?
body: <p>While trying to take a picture from the camera, and saving it on the cache folder of the app, I get no visible result. 
  App doesn't crash, but on the LogCat I got this message once I try to set an ImageView src field to the URI of the file just taken:</p>
  
  <blockquote>
  <pre><code>09-17 14:03:32.200: I/System.out(5104): Not a DRM File, opening notmally
  09-17 14:03:32.200: I/System.out(5104): buffer returned 
  09-17 14:03:32.205: D/skia(5104): --- SkImageDecoder::Factory returned null
  09-17 14:03:32.205: I/System.out(5104): resolveUri failed on bad bitmap uri: /data/data/com.example.me/cache/prefix1708798995.jpg
  </code></pre>
  </blockquote>
  
  <p>Code is quite simple, actually:</p>
  
  <pre><code>File tempFile;
  
  try {
      tempFile = File.createTempFile("prefix", ".jpg");
  } catch (IOException e) {
      e.printStackTrace();
      AppUtil.showErrorToUser(getApplicationContext(), getResources().getString(R.string.ERROR_upload));
      return;
  }
  
  mCameraImage = tempFile.getAbsolutePath();
  Uri uri = Uri.fromFile(tempFile);
  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
  startActivityForResult(intent, CAMERA_REQUEST_CODE);
  </code></pre>
  
  <p>And, in the <code>onActivityResult()</code>:</p>
  
  <pre><code>mIvAttach.setImageURI(Uri.parse(mBodyLocalUri));
  </code></pre>
  
  <p>I'm also <strong>very</strong> disappointed that I can't verify if pictures are actually taken, since I can't access <code>/data/data/myapp</code> folder (my GS3 is not rooted, and I still care about my warranty), therefore I'm not able to tell where the problem's very origin is.</p>