Last active
April 17, 2019 05:48
-
-
Save jirawatee/23595498bfae72d7eb6c2d17ed71fb0b to your computer and use it in GitHub Desktop.
Firebase Storage - Delete file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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