FileDocCategorySizeDatePackage
HardwareCanvasSurfaceViewActivity.javaAPI DocAndroid 5.1 API3869Thu Mar 12 22:22:44 GMT 2015com.android.test.hwui

HardwareCanvasSurfaceViewActivity

public class HardwareCanvasSurfaceViewActivity extends android.app.Activity implements android.view.SurfaceHolder.Callback

Fields Summary
private android.view.SurfaceView
mSurfaceView
private RenderingThread
mThread
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        FrameLayout content = new FrameLayout(this);

        mSurfaceView = new SurfaceView(this);
        mSurfaceView.getHolder().addCallback(this);

        content.addView(mSurfaceView, new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.MATCH_PARENT,
                FrameLayout.LayoutParams.MATCH_PARENT,
                Gravity.CENTER));
        setContentView(content);
    
public voidsurfaceChanged(android.view.SurfaceHolder holder, int format, int width, int height)

        mThread.setSize(width, height);
    
public voidsurfaceCreated(android.view.SurfaceHolder holder)

        mThread = new RenderingThread(holder.getSurface());
        mThread.start();
    
public voidsurfaceDestroyed(android.view.SurfaceHolder holder)

        if (mThread != null) mThread.stopRendering();