Code example for Surface

Methods: lockCanvas

0
		if (mHolder != null) {
			Surface surface = mHolder.getSurface();
			 
			if (surface != null) {
				try { 
					mCanvas = surface.lockCanvas(null);
				} catch (IllegalArgumentException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();
				} catch (OutOfResourcesException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();
				} 
			} 
		} 
		return mCanvas;
	} 
 
	//this will swap foreground and background buffers 
	public void swapBuffers() { 
Connect your IDE to all the code out there  Get Codota for Java