[英]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.