[英]How can I hide some images (saved on the sdcard by my app) from the Gallery app in Android?
My app is saving some images on the SD Card, in the AppImages directory 我的应用程序将一些图像保存在SD卡的AppImages目录中
The inbuilt gallery app is detecting these images and showing them on the gallery. 内置的图库应用正在检测这些图像并将其显示在图库中。
It is possible to hide these images and to be visible only for my app? 是否可以隐藏这些图像,并且仅对我的应用可见?
Thanks 谢谢
Rename the directory from AppImages
to .AppImages
. 将目录从
AppImages
重命名为.AppImages
。 The dot "hides" this folder from the system. 点从系统“隐藏”此文件夹。
On an unrelated note, consider naming the folder something less generic to lessen the chance that it already exists. 无关紧要的是,考虑为文件夹命名一些不太通用的名称,以减少该文件夹已经存在的机会。
You could stop the gallery from picking up your apps photos by putting a .nomedia
file in the folder where they are stored. 您可以通过将
.nomedia
文件放在存储照片的文件夹中,来阻止图库拾取照片。 This will stop the gallery app from detecting your images, but a user still can open them in the gallery by using a file manager to navigate to the directory and selecting an image. 这将阻止图库应用检测到您的图像,但是用户仍然可以通过使用文件管理器导航到目录并选择图像来在图库中打开它们。
Hiding the images from both the user and the gallery is not possible, AFAIK. AFAIK无法同时隐藏用户和图库中的图像。
无需隐藏图片。只需将扩展名重命名为“ .txt”即可显示图片,例如不受支持的文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.