views:

60

answers:

1

I want display the images saved in the cell phone in my own application. now I am using MediaStore.Images.Media to do this. I can get the name, size and other information of the images. but i don't know how to get the bitmap? can u help me. thx.

There is a method getBitmap(ContentResolver cr, Uri url), but i don't know how to get the Uri of one certain image.

thx.

A: 

The content uri will the base content uri appended with the id of the image you want. You can build with:

Uri bitmapUri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 
                 c.getLong(c.getColumnIndex(MediaStore.Images.Media._ID));
Nic Strong
perfect. thx very much!
ZHAO Xiaojian