Note that there are some explanatory texts on larger screens.

plurals
  1. PODeleting a gallery image after camera intent photo taken
    primarykey
    data
    text
    <p>I know this has been asked in many different ways but I still can not seem to delete the gallery image from the default folder. I'm saving the file to the SD card correctly and I can delete that file fine, but the default gallery image file that shows under the folder Camera will not delete.</p> <p>I would like the image to delete once the activity is returned since the file is already stored on the SD card under <code>/Coupon2</code>. </p> <p>Any suggestions?</p> <pre><code>public void startCamera() { Log.d("ANDRO_CAMERA", "Starting camera on the phone..."); mManufacturerText = (EditText) findViewById(R.id.manufacturer); String ManufacturerText = mManufacturerText.getText().toString(); String currentDateTimeString = new Date().toString(); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File filedir = new File(Environment.getExternalStorageDirectory()+"/Coupon2"); filedir.mkdirs(); File file = new File(Environment.getExternalStorageDirectory()+"/Coupon2", ManufacturerText+"-test.png"); outputFileUri = Uri.fromFile(file); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(intent, CAMERA_PIC_REQUEST); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == CAMERA_PIC_REQUEST &amp;&amp; resultCode == -1) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.putExtra("crop", "true"); intent.putExtra("scale", "true"); intent.putExtra("return-data", false); intent.setDataAndType(outputFileUri, "image/*"); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(intent, CAMERA_CROP_REQUEST); }else { SetImage(); saveState(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload