简体   繁体   English

隐藏图库中的图像 - 仅在自己的应用程序中显示?

[英]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?编辑:有人可以显示一些关于如何设置此路径的代码,以便在拍摄照片并且用户在相机应用程序中按下保存时,它会保存到 getFilesDir 路径?

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 .不要将它们存储在MediaScanner索引的地方。 That could be in your application-local file store (eg, getFilesDir() ), or on external storage in a directory that has a .nomedia file.这可能在您的应用程序本地文件存储(例如getFilesDir() )中,或者在具有.nomedia文件的目录中的外部存储中。

I have tried storing image as blob in sqlite db, but the image still appears in the gallery我已尝试将图像存储为 sqlite 数据库中的 blob,但图像仍出现在图库中

Either you did not store the "image as blob in sqlite db", or the images also existed in the file system somewhere.要么您没有将“图像作为 blob 存储在 sqlite db 中”,要么图像也存在于文件系统中的某个位置。 I am very confident that an "image as blob in sqlite db" did not get indexed.我非常有信心“sqlite db 中的 blob 图像”没有被编入索引。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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