Android Camera API - Force Close Does Not Release Camera Resource [closed]

孤者浪人 提交于 2019-12-05 19:03:07

From chasing up on all the other posts you have made on this subject, it appears like there is no sure fire way of getting the camera back after a crash without a restart of the device. A pain, to be sure. Best option is not to crash / catch everything that might fault. Which is a pretty rubbish answer, but that's what I'm endeavouring to do now.

Lots and lots of try catch !

I suggest you to see the code of google sample apps completely. the link is as follow. https://github.com/googlesamples/android-Camera2Basic As you can see in Camera2BasicFragment, mCameraOpenCloseLock Semaphore used to resolve release resources problems.

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