Issue
nyone can help. I am trying to get all available pictures on the sdcard. I have placed images (JPG) into the sdcard and pictures directory but the following code always returns 0 records.
// Set up an array of the Thumbnail Image ID column we want
String[] projection = {MediaStore.Images.Thumbnails._ID};
// Create the cursor pointing to the SDCard
Cursor cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
projection, // Which columns to return
null, // Return all rows
null,
null);
Where is this code actually looking? Because it is not picking up any images that i have placed in Pictures / DCIM as well (in the emulator).
EXTERNAL_CONTENT_URI points to which directory on the sdcard?
I know I am doing something wrong, any ideas what?
Thanks in advance
EDIT
After reading some comments i may be doing this wrong?
I need to display some images in a specific directory on the sdcard .. this directory will not have been imported to the gallery....
So the Cursor is not of any use here?
The cursor is only for searching the database of the gallery?
Is this correct?
Thanks
Solution
If the pictures are in your own directory and Mediasccanner is not scanning them, then the db will not have your pictures data. So then you cannot use the query to get these pictures.
Answered By - nandeesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.