Uri downloaduri=taskSnapshot.getDownloadUrl();//here i cant use getdownloadurl() function DatabaseReference new_prod=db.push(); new_prod.child("product name").setValue(prod_name); new_prod.child("product price").setValue(prod_price); new_prod.child("available stock").setValue(prod_quan); new_prod.child("product image").setValue(downloaduri); pd.dismiss();//fragments code I was unable to use getdownloadurl .I have already stored image in the firebase storage.Is it the fragment that is restricting the use of getdownloadurl? My motive is to make a query to store in firebase.please help me.