我有一个相机应用程序,我可以做一些帮助。在我的Camera Fragment中,我调用了takePicture方法,我打算暂停预览(根据the API)。当拍照时预览没有暂停
在我旧的HTC One X上这是真的,但刚升级到HTC One mini2,预览不再停顿。
这是否有合乎逻辑的原因?对我的代码的任何建议更改?
我打电话takePicture用下面的代码:
if (myCamera != null) {
FragmentManager fm = getFragmentManager();
PhotoHandler myphotohandler = new PhotoHandler(fm, mycontext, getView(), Photo_Type, photonumber, getDir(Project_Name), lmanager, projecttag);
ShutterCallback shutter = new ShutterCallback() {
public void onShutter() {
button_takephoto = (ImageButton) getView().findViewById(R.id.button_takephoto);
button_takephoto.setImageResource(R.drawable.shutter_closed);
}
};
myCamera.takePicture(shutter, null, null, myphotohandler);
而且我PhotoHandler类实现PictureCallback。
任何建议或类似的经验,将不胜感激。
兴奋地获得这篇文章的风滚草奖,但有任何其他人处理相机,不会暂停预览时拍摄照片? – bbarrett 2015-05-24 19:23:43
晚会有点晚,但是。在我的HTC One上,我可以拍摄第一张照片,预览可以正确暂停。然后,如果用户丢弃图片,我恢复预览,当他拍摄第二张图片时,预览不会暂停。你有没有找到一个很好的解决方法? – 2015-06-19 15:05:29
@MartinDevillers嗨,感谢您的评论。我找到了一个解决方法,在拍摄照片后生成暂停预览。我现在将它发布为我的问题的答案。谢谢。 – bbarrett 2015-06-22 23:31:36