Code example for SurfaceHolder

Methods: addCallback, setType

0
        // Install a SurfaceHolder.Callback so we get notified when the 
        // underlying surface is created and destroyed. 
        mHolder = getHolder();
        mHolder.addCallback(this);
        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        mActivity = (Activity)context;
    } 
 
 
    /** 
     * Activates everything when the surface is created 
     */ 
	 @Override 
	public void surfaceCreated(SurfaceHolder holder)
     { 
		 mHolder = holder;
		// if (mCamera != null) 
		// initiateCamera(); 
	 } 
 
	 /**