- Forum posts: 1
Oct 17, 2016, 9:39:01 AM via Website
Oct 17, 2016 9:39:01 AM via Website
I am using Camera for Barcode scanner App and On Some devices(LG G Flex, Asus Nexus 7) getting : Android Run time Exception -Failed to Connect Camera Service.
Here is the snippet from menifest file below :
uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
uses-permission android:name="android.permission.CAMERA"
....
....
I am releasing camera on pause, stop and on destroy.
/**
* 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();
}
}
Still getting above runtime exception, and i do not have above two devices so that i can reproduce.
Is there any solution of that issue?
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.