简体   繁体   中英

Hide images from gallery - Show only in own application?

How do I take pictures with the camera and ensure that the taken pictures are only visible from within my own application. ie I don't want the pictures to appear in the gallery app?

EDIT: Can someone show some code on how to set this path such that when the picture is taken and the user presses save in the camera app, it saves to getFilesDir path?

How do I take pictures with the camera and ensure that the taken pictures are only visible from within my own application.

Don't store them someplace that is indexed by the MediaScanner . That could be in your application-local file store (eg, getFilesDir() ), or on external storage in a directory that has a .nomedia file.

I have tried storing image as blob in sqlite db, but the image still appears in the gallery

Either you did not store the "image as blob in sqlite db", or the images also existed in the file system somewhere. I am very confident that an "image as blob in sqlite db" did not get indexed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM