Question

I'm building an application which download images from the web and store them into my SDCard, in order to make them invisible in the gallery I put this line to generate a .nomedia file:

FileWriter f = new FileWriter("/sdcard/Android/data/CopyImage/cache/.nomedia");

the application can successfully download the image and make the .nodata file on the same folder, but the thing is, the image is still appear on the gallery.

How could that be? Can anybody provide me a solution?

Thank you very much

Was it helpful?

Solution

Add a "." to the beginning of folder name instead.

BTW which phone is giving u this issue. My guess is that ur seeing old cached files in the Gallery

OTHER TIPS

The .nomedia file has to be the first file in a folder in order to ignore media there. If files are already indexed, just rename such folders forth and back (opening the Gallery in the middle) and there you go.

After you created the ".nomedia" file, you must reboot you phone and then the images of the folder will not appear on the gallery.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top