【问题标题】:Android Firebase -- Storing Google Profile PictureAndroid Firebase -- 存储 Google 个人资料图片
【发布时间】:2017-01-21 16:17:15
【问题描述】:

我正在为我的应用创建一个帐户设置页面。所以我提供了一个 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)

非常感谢任何帮助!

【问题讨论】:

  • 到底是什么问题?

标签: java android firebase firebase-authentication


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-28
    • 2019-10-17
    • 2013-03-24
    • 1970-01-01
    • 2018-10-24
    • 2018-08-25
    • 1970-01-01
    相关资源
    最近更新 更多