hectichavana
hectichavana

Reputation: 1446

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?

Upvotes: 14

Views: 24216

Answers (3)

alan wang
alan wang

Reputation: 59

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

Upvotes: 2

user1420526
user1420526

Reputation:

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.

Upvotes: 9

the100rabh
the100rabh

Reputation: 4147

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

Upvotes: 10

Related Questions