0
카메라를 바코드 스캐너 응용 프로그램 및 일부 장치 (LG G Flex, Asus Nexus 7)로 사용 중입니다. Android 런타임 예외 - 카메라 서비스 연결에 실패했습니다. 나는 일시에 카메라를 출시하고Android 런타임 예외 - 카메라 서비스 연결에 실패했습니다.
`uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
uses-permission android:name="android.permission.CAMERA"
....`
중지에 파괴 : 여기 아래 menifest 파일의 조각입니다.
/**
* Restarts the camera.
*/
@Override
protected void onResume() {
super.onResume();
try {
startCameraSource();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Stops the camera.
*/
@Override
protected void onPause() {
super.onPause();
if (mPreview != null) {
mPreview.stop();
}
}
/**
* Releases the resources associated with the camera source, the associated detectors, and the
* rest of the processing pipeline.
*/
@Override
protected void onDestroy() {
super.onDestroy();
if (mPreview != null) {
mPreview.release();
}
}
여전히 런타임 예외가 발생하며 위의 두 가지 장치가 없어 재현 할 수 있습니다. 그 문제의 해결책이 있습니까?
<uses-permission android:name="android.permission.CAMERA" />
당신은 안드로이드 M 권한 모델을 사용하는 경우, 앱이 실행 중이 권한을 가지고 있는지 확인하고이 먼저 필요가 메시지를 표시하는