如何处理好摄像头的Andr​​oid意图 [英] how to handle camera intent android

查看:98
本文介绍了如何处理好摄像头的Andr​​oid意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是工作在Android中的一些摄像头的东西,我得到一些教程。

I was working on some camera stuff in android and i get some tutorials.

有关我的需要我去使用以下code:

For my needs i get the following code to be used:

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

但是使用这个当我捕捉图像,这种意图自动存储图像在我的SD卡。但我不希望它其存储到我的SD卡,因为我的图像存储在SD卡其他地方/文件夹。因此,它是有可能在这里,我可以停止这种意图将图像自动保存到SD卡。

But using this when i capture the image, this Intent automatically stores the Image in my SD CARD. but i dont want it to store it to my SD CARD because i am storing that image to some other place/folder in SD Card. So is it possible in here that i can stop this intent to store the image into SDCard automatically.

请朋友帮助

推荐答案

用这个。这将图像保存到任何 MyFolder中在你的SD卡。

use this . It will save the image to any myfolder in your SDCard.

String imageFilePath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/myfolder/myfavoritepicture.jpg";
File imageFile = new File(imageFilePath);
Uri imageFileUri = Uri.fromFile(imageFile);
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri);
startActivityForResult(i, CAMERA_RESULT);

这篇关于如何处理好摄像头的Andr​​oid意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆