How do I restrict the display of some folders in the gallery? android

1

I know to list all the photos in the gallery but I do not need the Download folder to appear in the listing. I know I can filter but I can not get it to work.

I do not want the parameter in the query to collate so that the download folder is not displayed. But if anyone knows how to display in the gallery just the photos of the camera folder is already willing.

My code that lists all works but how do you 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){

                    }
                }
    
asked by anonymous 18.07.2018 / 14:40

1 answer

0

I followed this: link and It worked.

I created a .nomedia file and put it in my folder that I did not want it to display.

    
18.07.2018 / 21:09