Demo Tutorial for  filtering images for mime type
I am browsing list of images names of *.png ,*,jpeg, it is working
correctly
I am filtering images of type png and jpeg, IS there in other smart
way to achieve this, some thing we can do in manifest or   coding so
that we will get desired cursor of images(*.png and *.jpeg).

cursor = managedQuery(Media.EXTERNAL_CONTENT_URI, null, null, null,
null);

private void getColumnData(Cursor cur){
        if (cur.moveToFirst()) {

                String id;
                String title;
            String name;
            String mime;
            String imagePath;

            int idColumn = cur.getColumnIndex(Media._ID);
            int titleColumn = cur.getColumnIndex(Media.TITLE);
            int nameColumn = cur.getColumnIndex(Media.DISPLAY_NAME);
            int mimeColumn = cur.getColumnIndex
(Media.MIME_TYPE);

            do {
                // Get the field values
                id = cur.getString(idColumn);
                title = cur.getString(titleColumn);
                name = cur.getString(nameColumn);
                mime = cur.getString(mimeColumn);
                if(mime.equals("image/jpeg")||mime.equals("image/png"))
{
                imagePath = id + ":" + title + ":" + name;

                directoryFiles.add(imagePath);
                }
            } while (cur.moveToNext());

        }
    }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to