I am trying to access the camera in Android to get the live video. I am trying to set my Content View to camera_surface. However, Eclipse gives me error as camera_surface cannot be resolved or is not a field
My code is as follows:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera_surface);
surfaceView = (SurfaceView) findViewById(R.id.surface_camera);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
Could anyone tell what is wrong?
The problem was that I needed to create a file called
camera_surface.xmlin theres->layoutfolder and that solved the problem.