Prevent a Media Directory from Appearing in Android Gallery

The Gallery application on Android devices is a bit aggressive about scanning and adding directories. Have a directory you want to keep private? Use this simple trick to keep it out of the Gallery app.

If you want to use the Gallery app to show people pictures of your kid/dog/home remodeling project and not your girlfriend’s chest/drinking exploits/night at the club then this tip is for you. By default Android’s Gallery application is aggressive about adding media. It assumes that if it is on your SD card then you want it in your gallery for easy access. This isn’t always the case and, thankfully, it’s easy to fix. At the computer trips and tricks blog Addictive Tips they share three ways you can prevent Gallery from going crazy and indexing everything on your phone. How do you do this? Like so:

Using any file explorer/manager application (such as Astro File Manager or File Expert), navigate to the directory that you want hidden and create an empty file titled “.nomedia”.

One way to do so is to:

  • Copy an existing text (.txt) or even an image (.jpg/.png) file to said directory,
  • Open it in a text editor (hold down on the file and select the appropriate option from the context menu that appears),
  • Delete its contents (hold down on the text, Select all and Delete), save changes and exit,
  • Rename it to “.nomedia” (hold down on the file again and select Rename from its context menu).

This method disables media scanning on the chosen directory, causing the Gallery to skip the directory altogether at launch.

Restart Gallery and the directory you added the .nomedia file to will no longer appear. For the other two methods, hit up the link below.

How To Prevent a Directory From Being Scanned By Android Gallery [Addictive Tips]

Jason Fitzpatrick is a warranty-voiding DIYer who spends his days cracking opening cases and wrestling with code so you don't have to. If it can be modded, optimized, repurposed, or torn apart for fun he's interested (and probably already at the workbench taking it apart). You can follow him on if you'd like.