android: how to hide folder from appearing in the

2019-01-24 02:01发布

问题:

I have an application that creates a folder in the sd-card. After that, I do several operations which may result in storing different media files, graphics in my folder. The problem is that this folder is then visible in the Gallery section which is not appropriate. How can I hide the folder or the contents of my folder from appearing in the Gallery?

Looking forward for a response Thanks

回答1:

Put a file named .nomedia in the folder. This can be a zero-byte file if you want -- the name is what matters.



回答2:

Go to My Files folder, then Pictures or create a folder and name it whatever you want. Go the newly created folder, add another folder again and name it .nomedia. Copy or move photos in the folder (not the .nomedia coz it won't show after creating it). Then you check in the gallery, and voila! Folder isn't shown!

PS: The pictures you have copied/moved can be viewed only in My Files folder, which is much safer.. ;) PPS: This works on my samsung galaxy win.

Hope I had helped a little Thanks.



回答3:

You will start the name of the folder with a period (.). Example: .asdhsj



回答4:

Just start the folder name with period (.), it can be any name, but needs to start with period. After that the folder and it's files don't appear in gallery anymore :)



回答5:

For people who are on android version 5.1.1 some of you cant do this but what you can do is change the extention of that file, for example image.png change ".png" to something like ".txt" or something that way it doesnt show up in your gallery



回答6:

Happily album covers has a solution.

Here is the solution ; Rename all album cover picture files to albumart.jpg

My detailed answer can be found here Stop images on sd card from showing up in gallery?