简体   繁体   中英

Camera2 API Camera Manager Suspicious Cast

While trying to use the Camera manger class for a school project, I get the error: Suspicious cast to CameraManager for a CAMERA_SERVICE: Expected CameraManager. The line where the error occured was: CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);

I suspect that you have a custom class, called CameraManager , and you are implicitly casting to that one instead than Android original one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM