如何把多张照片,相机解雇前的意图? [英] How to take multiple photos before dismissing camera intent?

查看:110
本文介绍了如何把多张照片,相机解雇前的意图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想采取通过使用一个意图(MediaStore.ACTION_IM​​AGE_CAPTURE)推出了默认的设备摄像头应用程序多张照片。随着我搭配,相机启动测试设备,拍照,请求确认,然后返回到我的活动我的处理结果。

I am trying to take multiple photos using the default device camera application launched through an intent (MediaStore.ACTION_IMAGE_CAPTURE). With the devices I am testing with, the camera launches, takes a picture, asks for confirmation, then returns to my activity where I process the result.

我用广播接收器回调或内容观察者已经考虑;但是,我无法找到一个方法来启动相机,直到用户完成保持活跃。如果可能的话,我希望避免开发自定义的摄像头应用程序。

I've considered using broadcast receiver callbacks or a content observer; however, I cannot find a way to launch the camera and keep it active until the user is finished. If possible, I wish to avoid developing a custom camera application.

我必须这样做的原因是因为用户通常需要采取多张照片连续,并在某些设备上的相机的启动时间是向上的5秒,并使用该软件的用户需要10 - 30张照片连续;不仅如此,但他们需要在不同的相机参数的控制。

The reason I must do this is because users commonly need to take multiple photos in succession, and on some devices the camera start-up time is upwards of 5 seconds, and the users using the software take 10 - 30 photos consecutively; not only that, but they need control over various camera parameters.

有没有办法来启动相机意图和只能回到我的活动一旦用户退出相机应用程序?

Is there a way to launch the camera intent and only return to my activity once the user exits the camera application?

推荐答案

我通过SDK文档有一个为设备摄像头替代意图的行动,启动了相机在静止图像模式,直到用户完成不退出发现与该活动:

I discovered through the SDK documentation that there's an alternative intent action for the device camera that launches the camera in still image mode and does not exit until the user is finished with the activity:

Intent intent = new Intent(
    MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
this.startActivity(intent);

再加上我所需要完成一个ContentObserver这正是。

Coupled with a ContentObserver this was exactly what I needed to accomplish.

这篇关于如何把多张照片,相机解雇前的意图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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