Image permissions (do not want them in the gallery)

I am working on an application that stores its images in the Android / data folder. Images are visible in the gallery, but I do not want this.

Is it possible to set permissions on a folder so that they can be used only by the application itself, or just save them in another folder?

+2
source share
1 answer

Create a file with a name .nomediain the folder. This will hide them from the gallery app.

Here's how to do it in Java code:

File nomedia = new File(dataFolder, ".nomedia");
try {
    nomedia.createNewFile();
} catch (IOException e) {
    e.printStackTrace();
}
+7
source

All Articles