The URL(Image) getting stored in the Firebase database should point to the resource itself that is it should open the image itself But in my database the URL doesn't open up the image. I am cropping an image and saving it in database.
if(task.isSuccessful())
{ Toast.makeText(SetupActivity.this, "Photo saved", Toast.LENGTH_SHORT).show();
final String downloadUrl = task.getResult().getStorage().getDownloadUrl().toString();
UsersRef.child("profileimage").setValue(downloadUrl).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task)
{
StorageReference filepath = UserProfileImageRef.child(currentUserId + ".jpg");
filepath.putFile(imageUriResultCrop).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task)
{
if(task.isSuccessful())
{
Expected output :- profileimage:https://firebasestorage.googleapis.somefilename/v0" But what i get is - Real output :-profileimage:"com.google.android.gms.tasks.zzu@dd"