拍完一张照片后,Android 相机冻结 [英] Android camera freezes after taking one photo
问题描述
我正在用相机做一个项目,在拍摄一张照片后相机冻结,你必须完成活动并再次回忆它以拍摄另一张照片,我怎样才能让照片冻结 1-2 秒然后表面视图再次拥有相机.相同的视频我正在使用媒体记录器,拍摄视频按下停止视频保存并且屏幕仍然存在,但我不能再次拍摄视频我必须重新开始活动?
I'm doing one project with camera and after taking one photo camera freezes and u have to finish the activity and recall it again to take another photo, how can I take photo freeze for just 1-2 sec and then surface view to have the camera again. the same for video I am using media recorder, taking video press stop video saves and screen is still alive but I can not take video again I have to restart the activity?
有人有办法吗?
推荐答案
在后台AsyncTask
进行任何图像处理.这将允许您的 UI Activity 继续并拍摄另一张照片.
Do any image processing in a background AsyncTask
. This will allow your UI Activity to continue on and take another picture.
我无法删除已接受的答案,因此请参阅下面的 stoefin 答案.在拍摄下一张照片之前调用 camera.startPreview()
对他有效.
I cannot delete an accepted answer so please see stoefin's answer below. Calling camera.startPreview()
before taking the next photo works for him.
这篇关于拍完一张照片后,Android 相机冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!