Code example for SurfaceHolder

Methods: addCallbacksetFixedSizesetType

0
        mListener = listener;
        mSurfaceView = surfaceView;
         
        try { 
			mSurfaceHolder = mSurfaceView.getHolder();
			mSurfaceHolder.addCallback(this);
			mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
			mSurfaceHolder.setFixedSize(1, 1);
		} catch (Exception e) {
		} 
    } 
     
    @Override 
	public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
   		if (DEBUG) Log.d(TAG, "surface changed");
		mSurfaceReady = true;
		// were we waiting for the surface? 
		if (mWaitingSurface) {
			// yes, preview now 
			startPreview(); 
Stop searching for code, let great code find you!  Add Codota to your java IDE