【问题标题】:Loading images from dropbox to my Imageview将图像从 Dropbox 加载到我的 Imageview
【发布时间】:2014-01-05 07:55:35
【问题描述】:

我正在尝试将图片从 Dropbox 加载到我的 Imageview 中。 我正在获取图像的路径

storage/sdcard0/android/data/com.dropbox.android/files/scratch/camera%20uploads/2012-11-13%2020.22.13.jpg

但是,当我将 FileInputStream 连接到此路径时,它会给出 FileNotFoundException。如果我直接使用

BitmapFactory.decodeFile(filePath,options);

没有图片显示。

我无法从中创建位图以显示在我的 imageview 中。请更新如何将此图像读取到我的 Imageview 谢谢

【问题讨论】:

    标签: android


    【解决方案1】:

    尝试像这样写 Uri:

    "file:// + (这里是你的路径)"

    您可以使用 Picasso 轻松加载图像..

    Picasso

    像这样:

    Picasso.with(yourcontext)
     .load("file:// + (your path here)")
     .resize(50, 50)
     .centerCrop()
     .into(imageView)
    

    【讨论】:

    • 如果您尝试不使用“file://”但仍然使用毕加索,会发生什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-24
    • 2014-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多