将图像从Dropbox加载到我的Imageview

时间:2014-01-05 07:55:35

标签: android

我正在尝试将图片从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.kindly更新如何将此图像读取到我的Imageview 感谢

1 个答案:

答案 0 :(得分:0)

尝试像这样写Uri:

“file:// +(此处为您的路径)”

你可以使用Picasso轻松加载图片。

Picasso

像这样:

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