androidandroid-sdcardandroid-gallery

Android: .nomedia is ignored, images still appear on the gallery


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


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