1

I am trying to get download url from firebase but it gives me some another link like "com.google.android.gms.tasks.zzu@b9761c8"

enter image description here

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
  • You need to share your code as **TEXT** not as **IMAGE** – AskNilesh Sep 12 '18 at 04:42
  • Check this [How to Get Image URL after uploading an image form android to Firebase?](https://stackoverflow.com/questions/44686647/how-to-get-image-url-after-uploading-an-image-form-android-to-firebase) – AskNilesh Sep 12 '18 at 04:45

1 Answers1

1

You need to add listeners when retrieving the url.

Please read the documentations

taskSnapshot.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
    @Override
    public void onSuccess(Uri uri) {
        // Got the uri
        ImageUpload imageUpload = new ImageUpload(editText5.getText().toString(), uri.toString());
        // Wrap with Uri.parse() when retrieving

        String uploadId = mDatabaseRef.push().getKey();
        mDatabaseRef.child(uploadId).setValue(imageUpload);
    }
}).addOnFailureListener(new OnFailureListener() {
    @Override
    public void onFailure(@NonNull Exception exception) {
        // Handle any errors
    }
});
jbmcle
  • 771
  • 3
  • 12