且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Camera.start preVIEW崩溃和活动的多次运行后重新启动手机

更新时间:2023-02-26 22:18:28

SDK文档的android.hardware.Camera类说以下内容:

重要提示:呼叫发布()释放摄像头,以供其他用途   应用程序。应用程序应该立即松开相机   的onPause()(和再 - 的open() onResume())。

Important: Call release() to release the camera for use by other applications. Applications should release the camera immediately in onPause() (and re-open() it in onResume()).

您一定的活性释放相机的onPause() onResume重新打开它()

Are you certain your activity releases the camera in onPause() and re-opens it in onResume()?

如果您发布一个code样品,我们将能够更好地解决您的问题。

If you post a code sample, we would be better able to troubleshoot your problem.