Tell me if you can work with the camera via SurfaceVeiw in Dialog. There is a code to work with the camera with SurfaceView, for the Activity it works great.
class A extends Activity implements...{ ... } But if you change Activity to Dialog , the program crashes in this area of the code.
class A extends Dialog implements ... { ... @Override public void surfaceCreated(SurfaceHolder holder) { try { camera.setPreviewDisplay(holder); // crash here camera.setPreviewCallback(this); } catch (IOException e) { e.printStackTrace(); } }