How to keep images private to the app and not viewable in the gallery?

后端 未结 3 1623
长发绾君心
长发绾君心 2021-02-11 04:02

I am making an app to click pics and save that images in app folder.I want my images to be private to application only and not viewable in gallery. But with the code I have writ

3条回答
  •  春和景丽
    2021-02-11 04:57

    One way is to to name your images directory with a name that starts with a period, that will hide the images from the media scanners. So in your case the name might be ".Car Camera".

    Alternatively, you can put an empty file in the directory (alongside your images) with the name ".nomedia".

    Here's a link that describes these options it a bit more.

提交回复
热议问题