How to restrict that some folders are displayed in the gallery? android

Asked

Viewed 24 times

1

I know how to list all the gallery photos but I need the Download folder not to appear in the list. I know I can filter but I can’t make it work.

I do not parameter in the query I must paste so that the download folder is not displayed. But if someone knows how to display in the gallery only the photos from the camera folder is already willingly.

My code that lists all works but how does it filter some folders?

Cursor cursor = getActivity().getContentResolver().query(data.getData(),
                        new String[] { MediaStore.Images.Media.DATA },
                        null, null, null);
                if(cursor != null && cursor.moveToFirst()){
                    try{
                        int indice = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
                        caminho = cursor.getString(indice);
                    }catch(Exception e){

                    }
                }

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.