• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Nomedia not hiding recent files

I just cleared cache and rebooted, and the images are still in the gallery. So what's the short fix for this? Is there one?
Just speculation but I'd try replacing with that current .nomedia file with a new one, then use 'Clear data' on the Gallery app instead clearing its cache. This will force the app to re-scan your DCIM folder and re-index its internal database from scratch.
 
I just cleared cache and rebooted, and the images are still in the gallery. So what's the short fix for this? Is there one?
@The_Chief can you try the following if you have not already:
  • On your SD card create a hidden folder IE ".myfoldername"
  • Within that folder create a standard subfolder IE "Photos"
  • Places some photos within the subfolder and see if they appear in the gallery.
I already have a hidden folder on my SD card and the gallery app has never picked up anything within this folder and I don't use a .nomedia file within the structure.

Just speculation but I'd try replacing with that current .nomedia file with a new one, then use 'Clear data' on the Gallery app instead clearing its cache. This will force the app to re-scan your DCIM folder and re-index its internal database from scratch.
Here is the thing, in my testing via internal storage the app automatically removed all images and thumbnails when the nomedia file was placed in the camera folder. There was no notification within the app there was a nomedia file present unless I cleared the cache.

When I removed the nomedia file; the gallery automatically rescanned. I believe this is how it should work, at least this is how things use to work. Although it looks like Samsung has introduced a detection within the app that is not working correctly.

As for the SD card even when you clear the app cache after placing the .nomedia file; within the gallery it still shows thumbnails, all be it grey with an explanation mark. So the app clearly is not functioning correctly.
 
Last edited:
Okay, so I went to Settings - - > Apps and cleared cache and data for the Gallery. I then rebooted the phone. After giving the phone a minute or so for startup, I opened the Gallery.

Again, the photos in question are STILL visible, even in the folder with the '.nomedia' file in it! So that didn't work.

I also don't understand the suggestion that the file may be corrupt and need to be replaced, as the '.nomedia' file is a completely blank text file with 0kb of data. The significance is not in the content, but in the filename, which has never changed.

This leads me to believe that there is something new in the Android OS that is disregarding '.nomedia' for any files more recent than the change in the OS. I am not smart enough in the coding department to even speculate on the mechanics of that.
 
This leads me to believe that there is something new in the Android OS that is disregarding '.nomedia' for any files more recent than the change in the OS. I am not smart enough in the coding department to even speculate on the mechanics of that.
You could well be correct there @The_Chief as there is a common issue here with new files showing. But here is the thing, is it a Samsung issue or is it OS related?

Sorry none of the fixes worked though. I do have one more idea though..

On the SD card you will have the normal android folder and within that the OBB sub-folder. This folder is protected by default with a .nomedia file that is generated by the OS so your gallery does not get filled with junk from games etc..

I've placed a photos folder in there and added images into it and nothing comes up in the Gallery app, even after a force close/cache clear. Maybe this will work for you?

Out of interest, I've added a screenshot. This is the gallery app your using right?
 

Attachments

  • Screenshot_20180623-225202_Google Play Store.jpg
    Screenshot_20180623-225202_Google Play Store.jpg
    159 KB · Views: 300
  • Screenshot_20180623-225244_Solid Explorer.jpg
    Screenshot_20180623-225244_Solid Explorer.jpg
    77.8 KB · Views: 272
If the above does not work, I would create a post in the Note forums and ask some users to try and replicate the issues your having; as for me any folder created that is hidden, the files stay that way.

I would also dig out an old SD card and sling it in the phone to eliminate that as an issue.
 
You could well be correct there @The_Chief as there is a common issue here with new files showing. But here is the thing, is it a Samsung issue or is it OS related?

Sorry none of the fixes worked though. I do have one more idea though..

On the SD card you will have the normal android folder and within that the OBB sub-folder. This folder is protected by default with a .nomedia file that is generated by the OS so your gallery does not get filled with junk from games etc..

I've placed a photos folder in there and added images into it and nothing comes up in the Gallery app, even after a force close/cache clear. Maybe this will work for you?

Out of interest, I've added a screenshot. This is the gallery app your using right?

No, I am not using the Samsung Gallery app - I'm using the stock Gallery app. See icon on my screen shot.
 
Oh, I thought the stock gallery on the Note8 would have been the same as I posted. Btw I cannot see any screenshot.
 
Well, that blew my theory.

I took a couple of photos that I really don't want showing up in the gallery and moved them to the Android/obb folder in internal storage. They disappeared from the gallery.

On a whim, I deleted the '.nomedia' file in my special folder and then copied the obb's version into it.

All photos in my folder disappeared from the gallery. I then moved the two photos from the obb folder to my special folder - and they are still hidden.

So okay, mind blown: how the heck an empty text file can get corrupted is beyond me... but apparently the fix was, in fact, to replace the '.nomedia' file with a known good one.

Kudos JAy!
 
This very much sounds like a permission issue then. Maybe a user created .nomedia file is not being flagged correctly when created?? The only way to test this theory is to check the files attributes on a PC and compare the 2. (not sure how to check this on android) If I get time later I'll check it out.

Glad we finally got to the point where you can finally hide them photos tho @The_Chief

Not a problem by the way, a pleasure. :thumbsupdroid:
 
I'm as happy about the prospect of solving the problem as I am getting those 'special' photos out of my gallery! That's a lot more detail than the Darling Bride would want a casual observer to stumble upon LOL
 
Well, that didn't last long. Suddenly, once again, new photos that have been moved to THAT folder are still showing up in the gallery. My mind is numb.
 
Damn it, I take it you have deleted the .nomedia file and replaced it with the system created file @The_Chief ?

Why don't you create a post in the Note8 forum and see if others can repeat the issue you are having so as to narrow it down to either your device or Note8s in general?
 
I'll try that. It's hard to believe that it would be an issue isolated to a single model of phone, but I'll try it. I'm sorry for the delay, I have been extremely busy lately and. nomedia files are way down my priority list LOL
 
@JAy3001 thank you for your detailed testing and analysis.

Yes, the .nomedia file IS an empty text file... so whether or not the ".txt" is at the end is a matter of whether or not the file explorer is set to show extensions.

When I take a photo that I do not want showing up in the gallery, I almost immediately open Solid Explorer, switch to landscape mode (which is a dual pane mode), navigate one pane to the DCIM/Camera subfolder (the other goes to the special folder with the .nomedia file in it), select said photo and MOVE it. It's a drag & drop operation, moving the photo from the DCIM/Camera subfolder to the other folder. Yet, when I open the gallery, that photo is still very visible... no placeholders at all. If I tap on that photo and look at the Details, it has the file location as my special folder. I have cleared cache AND data for the gallery in Settings, and it's still happening.

But it's only happening with RECENT photos: since just before I posted the OP. Not all the photos in the special folder are showing up in the gallery... just the newer ones. That led me to believe that Android 8.0 changed the way the .nomedia file works.

Your post said that you were confident that Android is treating the .nomedia file differently in internal storage than it does on external storage: aka the microSD card. Since I keep all of my photos, documents, music, videos and other important files on my microSD card, I would not have thought to experiment with that. To verify the results of your testing, I did the same thing. I moved a screenshot to the same special folder with the .nomedia file in it; and I moved another screenshot, from the same Screenshots folder in internal memory, to the Android/Data subfolder - also in internal memory, since it already has a .nomedia file in it.

Guess what?

The screenshot in my special folder is still visible, while the screenshot in Android/Data disappeared completely from the gallery!

So that pretty much PROVES that .nomedia still works with files in internal storage... but Android 8.0 apparently broke its functionality in external storage.

KUDOS to @JAy3001 !!!

Now it's a question of what to DO about it! Other than moving my special folder to internal memory, which I refuse to do for reasons previously stated, how do we work around this? I suppose a bug report to Google would be helpful, if one isn't already posted. But a fix to that could take months to deploy, if ever. In the immediate term, though, does anyone here have any ideas? I don't want to move the folder to the Samsung Knox Secure Folder either: while it is definitely secure on the phone itself, it will be inaccessible if the phone is ever dropped, damaged or replaced. I suppose I could just back up all the photos to OneDrive and then delete them from the phone, but that's a last resort...

EDIT: I wrote up a bug report on issuetracker.android.com so we'll see if it ever gets addressed.
 
Last edited:
Thanks for the kind comments @The_Chief

I connected Samsung regarding this issue, however their response was pretty useless. See attached pics.

As for the next steps.. not sure. Maybe if the SD card was formatted into "adoptable storage" the issue would not present itself. But this causes too many issues in my mind, least not that you will loose the separation between internal and external storage.

How about this @The_Chief . Look to the S9 forum, this phone has an SD card slot and should get Android 9 once it's released. Why not create a post in there looking for people to test the issues presented in this thread to see if the issue is fixed in android 9? I know this is not a solution, but it may give you some relief if you find out that android 9 fixes the issue.

Edit: I've just looked into a possible solution. I will stay that I have not had time to fully test this as we are out.

Firstly remove any nomedia file you have in your special folder.

Open up solid explorer and navigate to your special folder, now select Options, Properties, Options and tick Hide Media.

Restart you device.

Open up the gallery app and they should be hidden. Newly shot photos will appear in the folder when taken. However copy and pasted images will not show in the folder.

I tested this with my camera folder on SD card. Any newly created photos showed, however I copied them over to the internal space, checked the gallery app for them to go. (Quick restart here, not sure if you need to) Then pasted the moved files back into the camera folder, checked the gallery app and they did not show. Also any old files a copied into the folder did not show.

Let me know how you get on @The_Chief

(Sorry rushed post)
 

Attachments

  • Screenshot_20180806-115503_Samsung Members.jpg
    Screenshot_20180806-115503_Samsung Members.jpg
    262.5 KB · Views: 312
  • Screenshot_20180806-115506_Samsung Members.jpg
    Screenshot_20180806-115506_Samsung Members.jpg
    261.9 KB · Views: 287
  • Screenshot_20180806-124038_Solid Explorer.jpg
    Screenshot_20180806-124038_Solid Explorer.jpg
    188.2 KB · Views: 328
Yep, their response was pretty useless! And guess who's getting blamed by Google?

Thank you for reporting this issue. Unfortunately, this issue is not reproducible with our version of the AOSP source code for Pixel devices. Please file a bug with the respective OEM, as they are using their own customized version of the AOSP source code. This bug will be marked as closed.

So this is a classic Samsung cop-out...

If I understand you correctly, I will try to accomplish the same task without using the .nomedia file at all by using the 'hide files' feature in Solid Explorer. I would be very interested, however, in learning more about how that works.

You said that only existing photos would be hidden, and not any additional pictures. Did you try turning that feature OFF, moving photos into the folder, and then turning it back ON?

I'm almost inclined to just lose the local images, put them in a secure OneDrive folder and delete them off the phone...

Thanks again for your help and insight!

EDIT:

Okay, so I tried the 'Hide Images' function in Solid Explorer. I turned it on, rebooted the phone and went to gallery.

PHOTOS ARE GONE!

Going back to Solid Explorer and looking at the folder, it had been renamed a 9-digit number with a '-' on the front... like -123456789 and a .nomedia file had been created for it. Wonder of wonders...

However, turning that feature OFF did not cause any photos to reappear. So it will be interesting to see how it handles new photos when I take them later this month...
 
Last edited:
Ok, so I've done lots of testing and have confirmed the below to be working on my device:

  1. Create a new folder in the root of your SD Card for your photos,
  2. Copy and paste your photos into this newly created folder,
  3. Open up your gallery app to confirm the new folder and images show up,
  4. Open up Solid Explorer and browse to your newly created folder and hit Options, Preferences, Options, Hide Media,
  5. Open up you gallery app and see if the photos have gone, (assuming they are visible)
  6. Restart your device,
  7. Go back into your gallery app and see if the photos are gone, (assuming they have)
  8. Open Solid Explorer and copy/paste some more photos into your new folder,
  9. Go back to your gallery app and see if they appear. (Assuming not)
Notes:

When you request Solid Explorer to hide the media all it does it create its own .nomedia file.

For some reason even if I force stopped, cleared cache on my gallery app after applying the no media flag; the images still showeda. After a reboot tho they disappear.

I also found that if I reversed the process of hidding the photos using Solid Explorer I had to reboot again (further test needed here as reboot may not be necessary). But I had to cut and paste the images into my internal storage, check the gallery, then cut and paste them back into the original folder on the SD card for them to show.. :oops:
 
@JAy3001 well, isn't that a complicated and convoluted way of doing things? So apparently Samsung - not Google - changed the way their phones handle a .nomedia file that was not created by the system or an app: it disregards it.

I'm out right now but I will test it out when I get home. Thanks!
 
@JAy3001 in your last procedure, did you happen to come up with a way to add additional content to that folder and have everything still be hidden from the gallery?

I'm starting to think that I'll just keep the pictures in a special folder in OneDrive and delete them from the card entirely. Secure folder is a great option, until I want to change phones. Then I'd have to move everything out of the secure folder before transferring the files.
 
Thanks! I'll move everything OUT of that folder, all the subfolders, delete the folder, create another one, move all the subfolders into the new folder and then HIDE MEDIA.

Thanks, @JAy3001 by the time I get around to doing this, I'll be on the Note9 by then!

:p
 
Back
Top Bottom