Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Last active April 17, 2019 05:48
Show Gist options
  • Select an option

  • Save jirawatee/23595498bfae72d7eb6c2d17ed71fb0b to your computer and use it in GitHub Desktop.

Select an option

Save jirawatee/23595498bfae72d7eb6c2d17ed71fb0b to your computer and use it in GitHub Desktop.
Firebase Storage - Delete file
private void deleteFile() {
Helper.showDialog(this);
imageRef.delete().addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Helper.dismissDialog();
mImageView.setImageDrawable(null);
mTextView.setText(String.format("%s was deleted.", imageRef.getPath()));
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Helper.dismissDialog();
mTextView.setText(String.format("Failure: %s", exception.getMessage()));
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment