mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Merge pull request #343 from nathbenjwolf/master
Fixed the cameraId changing on powerbutton press
This commit is contained in:
commit
717c53ddbe
|
@ -176,16 +176,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
||||||
|
|
||||||
resetStatusView();
|
resetStatusView();
|
||||||
|
|
||||||
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
|
|
||||||
SurfaceHolder surfaceHolder = surfaceView.getHolder();
|
|
||||||
if (hasSurface) {
|
|
||||||
// The activity was paused but not stopped, so the surface still exists. Therefore
|
|
||||||
// surfaceCreated() won't be called, so init the camera here.
|
|
||||||
initCamera(surfaceHolder);
|
|
||||||
} else {
|
|
||||||
// Install the callback and wait for surfaceCreated() to init the camera.
|
|
||||||
surfaceHolder.addCallback(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
beepManager.updatePrefs();
|
beepManager.updatePrefs();
|
||||||
ambientLightManager.start(cameraManager);
|
ambientLightManager.start(cameraManager);
|
||||||
|
@ -261,6 +251,17 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
||||||
characterSet = intent.getStringExtra(Intents.Scan.CHARACTER_SET);
|
characterSet = intent.getStringExtra(Intents.Scan.CHARACTER_SET);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
|
||||||
|
SurfaceHolder surfaceHolder = surfaceView.getHolder();
|
||||||
|
if (hasSurface) {
|
||||||
|
// The activity was paused but not stopped, so the surface still exists. Therefore
|
||||||
|
// surfaceCreated() won't be called, so init the camera here.
|
||||||
|
initCamera(surfaceHolder);
|
||||||
|
} else {
|
||||||
|
// Install the callback and wait for surfaceCreated() to init the camera.
|
||||||
|
surfaceHolder.addCallback(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getCurrentOrientation() {
|
private int getCurrentOrientation() {
|
||||||
|
|
Loading…
Reference in a new issue