android - 临时存储的相机 Intent

标签 android android-camera android-camera-intent

是否存在拍照但不自动将照片保存到画廊的 Intent ?我目前正在使用 android.provider.MediaStore.ACTION_IMAGE_CAPTURE

最佳答案

您可以使用以下附加设置目标文件 uri:

intent.putExtra(MediaStore.EXTRA_OUTPUT,<Uri>);

文件必须是可写的。 完成文件后,只需将其删除,它就不会出现在图库中

如果您想将文件保留在 sd 上,而不让它在图库中可见,您只需更改它的扩展名,“file.tmp”将永远不会在图库中显示。

关于android - 临时存储的相机 Intent ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5990756/

相关文章:

android - 在Android Studio 3.x和CMake中静态链接库

android - 相机 Intent/Activity - 避免保存到画廊

android - 通过我的应用程序使用 Intent 打开相机时停止保存图像

android - 适用于 Jelly Bean 但不适用于 Kitkat 的相机 API

Android 安全异常 : Admin does not own the profile

java - 为什么我在尝试将 JSON 数据加载到 RecyclerView 时收到 NullPointerException?

android - 保存图片到新目录

java - 在 Camera2 api 上使用 captureBurst 时 JPEG 回调超时

Android:相机和图库 Intent 崩溃

android - 使用 bazel 编译 tensorflow android demo 时缺少输入文件@androidsdk//:build-tools/26. 0.1/aapt