Skip to content

Instantly share code, notes, and snippets.

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

  • Save jirawatee/324e75fa6fb09c48552a7d9d1fdacfec to your computer and use it in GitHub Desktop.

Select an option

Save jirawatee/324e75fa6fb09c48552a7d9d1fdacfec to your computer and use it in GitHub Desktop.
Firebase Storage - Get metadata
private void getMetadata() {
Helper.showDialog(this);
imageRef.getMetadata().addOnSuccessListener(new OnSuccessListener<StorageMetadata>() {
@Override
public void onSuccess(StorageMetadata storageMetadata) {
Helper.dismissDialog();
mTextView.setText(String.format("Country: %s", storageMetadata.getCustomMetadata("country")));
}
}).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