0
private void storeFireStore(final UploadTask.TaskSnapshot taskSnapshot, final String name, final String usernameToCompare) {

    final Uri download_uri;

    if (taskSnapshot != null) {
        download_uri = taskSnapshot.getDownloadUrl();
    } else {
        download_uri = mainImageUri;
    }
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Fregene
  • 3
  • 3
  • That's now how you can get the download URL. Please check the duplicate to see how you can solve this. – Alex Mamo Apr 17 '22 at 11:11
  • Determining the download URL requires a call to the server. Because of this, the call to `getDownloadUrl()` returns a `Task` that completes when the download URL comes back from the server. You'll need to call `addSuccessListener()` on it to wait for it to complete. See the documentation [here](https://firebase.google.com/docs/storage/android/download-files#download_data_via_url) and this [answer](https://stackoverflow.com/a/51064689) – Frank van Puffelen Apr 17 '22 at 14:20

0 Answers0