gpt4 book ai didi

java - Android Firebase -- 存储 Google 个人资料图片

转载 作者:行者123 更新时间:2023-12-01 08:59:45 27 4
gpt4 key购买 nike

我正在为我的应用程序创建一个帐户设置页面。所以我给出了一个 ImageView 来设置个人资料图片。

我通过以下方式加载图像:

Glide.with(AccountSetupActivity.this)
.load(mAuth.getCurrentUser().getPhotoUrl())
.into(mCircularProfile); //mCircularProfile is ImageView

它工作完美。问题是当我尝试存储此文件时。

mImageUri = mAuth.getCurrentUser().getPhotoUrl();

StorageReference filePath
= mStorageProfilePicturesRef.child("just a random name for testing");
//Putting The Image At The Specific File Path
filePath.putFile(mImageUri)

非常感谢任何帮助!

最佳答案

URL 和 Uri 之间是有区别的。该错误是因为您试图将字符串 URL 存储到 uri 中。将 Url 转换为 Uri。

mImageUri =  Uri.parse(mAuth.getCurrentUser().getPhotoUrl());

关于java - Android Firebase -- 存储 Google 个人资料图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41781592/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com