Code example for SurfaceHolder

Methods: isCreating

0
				//params.setPreviewSize(320, 240); 
				//params.setPreviewSize(w, h); 
				 
				camera.setParameters(params);
				 
				if (holder.isCreating()) {
					camera.startPreview();
					 
					thread = new Thread(new Runnable() {
						final Camera.PreviewCallback cb = new Camera.PreviewCallback() {
							public void onPreviewFrame(byte[] data, Camera camera) {
								synchronized (preview_lock) {
									camera.setPreviewCallback(null);
									preview = data;
									preview_lock.notify();
								} 
							} 
						}; 
						 
						public void run() { 
							while (!Thread.interrupted()) {