简体   繁体   English

如何在Android中的“图库”应用中隐藏一些图像(由我的应用保存在sdcard上)?

[英]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.

相关问题 从我的Android应用捕获的图像已保存,但未显示在图库应用中 - Images captured from my Android app are saved, but not displayed on the gallery app 我如何分析我在 android studio 的画廊中保存了哪些应用程序状态文件? - how i can analyze which whats app status file is already saved in my my gallery in android studio? 如何打开带有Android图库的应用程序中保存的图像? - How can I open an image saved within the app with the android gallery? 保存到 sdcard 的图像不会出现在 Android 的图库应用中 - Image, saved to sdcard, doesn't appear in Android's Gallery app 如何在Android仿真器中显示从SDcard到Gallery的图像 - How to display images from SDcard to Gallery in Android emulator 如何在Android应用程序的图库中显示保存的照片 - How to show saved photo in gallery in Android app 我可以在/ sdcard上下载SQLite数据库并从我的Android应用程序访问它吗? - Can I download an SQLite db on /sdcard and access it from my Android app? 如何在Android中卸载我的应用程序时从SDCard中删除文件夹? - How to delete folders from SDCard during uninstalling of my app in Android? Android Gallery小部件使用SDcard中的图像 - Android Gallery widget using images from SDcard Android画廊显示来自SDcard的图像 - Android gallery display images from SDcard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM