Get content uri from file path in android
Posted
by frieza
on Stack Overflow
See other posts from Stack Overflow
or by frieza
Published on 2010-06-09T09:53:01Z
Indexed on
2010/06/09
13:22 UTC
Read the original article
Hit count: 1353
Hi,
I know the absolute path of an image (say for eg, /sdcard/cats.jpg). Is there any way to the content uri for this file ?
Actually in my code I download an image and save it at a particular location. In order to set the image in an ImageView currently I open the file using the path, get the bytes and create a bitmap and then set the bitmap in the ImageView. This is a very slow process, instead if I could get the content uri then I could very easily use the method ImageView.setImageUri(uri)
Thanks
© Stack Overflow or respective owner