In my application, I am trying to configure the camera. My class extends SurfaceView and implements SurfaceHolder.Callback methods.
Here are some of my classes:
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback{ private SurfaceHolder mHolder; private Camera.Parameters cameraParameters; private Camera camera; public CameraPreview(Context context) { super(context); mHolder = this.getHolder(); mHolder.addCallback(this);
My question includes the setType method in the constructor. The API claims that the method is deprecated and ignored. However, if I comment that one line, the whole application will work when I call camera.startPreview (). I am trying to understand why this is so. If it is ignored, then it doesn't matter what I did with this method. This means that there is something very bad in this implementation.
I am running Android 2.2 software.
Any help would be appreciated.
source share