Code example for SurfaceView

Methods: getHolder

0
    public static void pushBitmap(final Bitmap b) {
 
        currentActivity.runOnUiThread(new Runnable() {
                public void run() { 
 
                    SurfaceHolder sh = sv.getHolder();
 
                    sh.setFormat(PixelFormat.RGBA_8888);
 
                    Canvas c = sh.lockCanvas();
                    c.drawBitmap(b, null, sh.getSurfaceFrame(), null);
                    sh.unlockCanvasAndPost(c);
                } 
            }); 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java