Code example for SurfaceHolder

Methods: getSurface, lockCanvas, unlockCanvasAndPost

0
	 
	/** 
	 * Tell the foreground to draw its sprites 
	 */ 
	private void drawSprites() { 
		if (holder.getSurface().isValid()) {
	        canvas = holder.lockCanvas();
	        foreground.draw(canvas);
	        holder.unlockCanvasAndPost(canvas);
        } 
	} 
	 
	/** 
	 * Task to handle the narrator giving instructions to the player 
	 * This one tells the player to throw the catch back. It repeats every 10 seconds after the first one. 
	 * @author undergear 
	 * 
	 */ 
	private class AudioTask extends AsyncTask<Void, Void, Void> {
 
		@Override