我正在为我的应用程序创建一个帐户设置页面。所以我给出了一个 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/