summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2009-08-11 17:26:35 +0800
committerWu-cheng Li <wuchengli@google.com>2009-08-11 17:30:15 +0800
commit5dfeb0e195c79915d47ebc61ec1b1e2375264a22 (patch)
tree9c4dac65e2adb2741472747051757b6b59b18d0f /samples
parente2778775411c3ef8d2d20351963715904135e9ec (diff)
downloadandroid_development-5dfeb0e195c79915d47ebc61ec1b1e2375264a22.tar.gz
android_development-5dfeb0e195c79915d47ebc61ec1b1e2375264a22.tar.bz2
android_development-5dfeb0e195c79915d47ebc61ec1b1e2375264a22.zip
Release the camera in surfaceDestroyed().
If the camera is not released, the new client will fail to connect to camera next time. b2042350
Diffstat (limited to 'samples')
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java b/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
index ceff15042..e3cf97696 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
@@ -78,6 +78,7 @@ class Preview extends SurfaceView implements SurfaceHolder.Callback {
// Because the CameraDevice object is not a shared resource, it's very
// important to release it when the activity is paused.
mCamera.stopPreview();
+ mCamera.release();
mCamera = null;
}