title: Delete picture taken from camera
body: <p>I'm trying to delete the picture just taken by the app because I already saved it to my tmp folder for later use and I don't want the picture to show up in the gallery.
  Problem is that I can't figure out how to do it, I tried a bunch of things and now I'm stuck.
  This is my latest code (the data in the <code>onActivityResult</code> is null and I don't know why):</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == TAKE_PIC &amp;&amp; resultCode == RESULT_OK) {
          Uri path = data.getData();
          new File(path.getPath()).delete();
          Toast.makeText(this, "Picture taken!", Toast.LENGTH_LONG).show();
      }
  }
  
  public void onButtonClick(View view) {
      CheckBox ckBox = (CheckBox) findViewById(R.id.cmark_picture);
  
      if (ckBox.isChecked())
          takePicture(view);
  }
  
  private void takePicture(View view) {
      tmpImg = new File(TMPDIR, "tmp.png");
      Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tmpImg));
      startActivityForResult(intent, TAKE_PIC);
  }
  </code></pre>