app passed NULL surface, while taking a picture without a surfaceview

心已入冬 提交于 2019-12-06 11:57:00

I think you should implement the interface SurfaceHolder.Callback first, and then add callback to the holder first, e.g.

mHolder.addCallback(callback)
myCamera.setPreviewDisplay(mHolder);
myCamera.startPreview(); 

I think it will be ok!!

If you have any problems, you can refer to 1.my https://github.com/RyanLiuNtust/Lecture-of-Android/tree/camera_lecture

You can't do it. There are some privacy issues with the camera. I have seen this answer on one of the boards here before but I don't have time to look that answer up again. You can't do it, because if your app takes a picture of something they should be able to know what it is of.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!