I am working on an android project using firebase for database but i am not able to retrieve the uploaded image as i can't get the url for the image i used .getDownloadUrl() method but it doesn't return the url but com.google.android.gms.tasks.zzu@9501820.
Asked
Active
Viewed 1,024 times
1
-
2This question is incomplete. You should paste at least a small piece of your code, that others users can reproduce. – luca.vercelli Apr 10 '20 at 11:49
1 Answers
3
You will have to register a callback on getDownloadUrl()
like below because it is an instance of Task
, not String
. Task
is asynchronous, you can't just do toString()
to get an url.
dateRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>(){
@Override
public void onSuccess(Uri downloadUrl) {
//do something with downloadurl
}
});

Krupal Shah
- 8,949
- 11
- 57
- 93