[英]Android Firebase — Storing Google Profile Picture
我正在为我的应用程序创建一个帐户设置页面。 因此,我提供了一个用于设置个人资料图片的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());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.