Erasing a gallery photo on Android

1

I have a code where I am using my camera to take a picture, then put it in an ImageView , just for viewing, as it is saved in my SQLite . I would like to know how do I delete this photo from the gallery since it is already in the database.

This is my code, here I am opening the camera and taking the picture.

private void tirarFoto() {
    Intent it = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

    if (it.resolveActivity(getPackageManager()) != null) {
         startActivityForResult(it, REQUEST_IMAGE_CAPTURE);
    }
}

Here I am taking the image taken and putting it in ImageView

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
      Bundle extras = data.getExtras();
      Bitmap imagem = (Bitmap) extras.get("data");
      imgEntrada.setImageBitmap(imagem);
   }
}
    
asked by anonymous 30.07.2018 / 14:09

0 answers