Hi All,

I would really be thankful if anyone can give clue whether it is
possible or not.



On Sep 15, 2:56 pm, Sd <[email protected]> wrote:
> I want to write code to display the images only from a particular
> folder in sdcard. e.g a folder named b'day(/sdcard/pictures/b'day).
> I have the following code, but it displays all the images in the
> sdcard. What should I add/change in the following code to accompalish
> my objective.
>
> private void displayGallery() {
>                 Uri uri =
> MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI;
>                  String[] projection = {
>
> MediaStore.Images.ImageColumns._ID,  // The columns we want
>
> MediaStore.Images.Thumbnails.IMAGE_ID,
>                                 MediaStore.Images.Thumbnails.KIND };
>                 String selection = MediaStore.Images.Thumbnails.KIND +
> "="  + // Select only mini's
>                 MediaStore.Images.Thumbnails.MINI_KIND;
>                 mCursor = this.managedQuery(uri, projection,
> selection, null, null);
>                 if (mCursor != null) {
>                         mCursor.moveToFirst();
>                         ImageAdapter adapter = new ImageAdapter
> (mCursor, this);
>                         Log.i(TAG, "displayGallery(), adapter = " +
> adapter.getCount());
>                         mGallery.setAdapter(adapter);
>                         mGallery.setOnItemClickListener(this);
>                 }
>         }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to