如何停止 MediaStore.ACTION_IMAGE_CAPTURE 复制图片
我正在使用以下代码来拍照:
private static final int TAKE_PHOTO_CODE = 1;
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tFile));
startActivityForResult(intent, TAKE_PHOTO_CODE);
该代码工作正常,但是我得到了我自动拍摄的每张照片的副本,这些照片出现在“相机镜头”画廊以及我想要照片去的地方。
如何阻止它自动复制我的图片?
该文件名甚至与我指定的文件名不同,因此我无法轻松删除它。
感谢您的帮助!
I am using the following code to take a picture:
private static final int TAKE_PHOTO_CODE = 1;
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tFile));
startActivityForResult(intent, TAKE_PHOTO_CODE);
This code works fine however I am getting a copy of every picture I take automatically appearing in the "Camera Shots" gallery as well as where I want the picture to go.
How do I stop it automatically copying my picture?
The file name is not even the same as the one I specified so it is not like I can delete it easily.
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案。
以下功能删除保存到媒体存储的最后一张照片。
请在 onActivityResult 中调用上述函数。
I have found a answer.
Following function delete the last photo saved to media storage.
Please call above function within onActivityResult.