在尝试将相机管理器类用于学校项目时,我收到错误:可疑强制转换为CameraManager for a CAMERA_SERVICE: Expected。出现错误的行是:CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
当我在我的android手机上运行这个,它运行正常,但手电筒没有启动。Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { String cameraId = null; // Usually back camera is at 0 position.Build.VERS
我正在尝试使用camera类在Android应用程序中以编程方式拍摄照片。目标API是最新的(在撰写本文时为N),但最低API为15。);CameraManager manager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);//A few more steps, but the key one here