2017-01-21 8 views
0

私のアプリのアカウント設定ページを作成しています。だから私はプロファイル写真を設定するためのImageViewを与えています。Android Firebase - Googleプロフィールを保存する画像

私は次のようにイメージをロードしています:

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) 

すべてのヘルプは大歓迎です!

+0

問題は何ですか? –

答えて

1

URLとUriに違いがあります。エラーは、文字列URLをuriに格納しようとしているためです.UrlをUriに変換してください。

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