Here I am trying to access the imgURL. Below I am trying to upload an image from my local storage onto the firebase storage. After doing so I would like to store that link into imgURL but I instead I am just getting null from imgURL.
private String imgURL;
StorageReference filepath1 = mStorage.child("Blog_Image").child(mcontentURI.getLastPathSegment() + random());
filepath1.putFile(mcontentURI).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
final Uri downlaodUrl = taskSnapshot.getDownloadUrl();
imgURL = downlaodUrl.toString();
}
});