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

CanvasTextureViewActivity

public class CanvasTextureViewActivity extends android.app.Activity implements TextureView.SurfaceTextureListener

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

        super.onCreate(savedInstanceState);

        FrameLayout content = new FrameLayout(this);

        mTextureView = new TextureView(this);
        mTextureView.setSurfaceTextureListener(this);
        mTextureView.setOpaque(false);

        content.addView(mTextureView, new FrameLayout.LayoutParams(500, 500, Gravity.CENTER));
        setContentView(content);
    
public voidonSurfaceTextureAvailable(android.graphics.SurfaceTexture surface, int width, int height)

        mThread = new RenderingThread(mTextureView);
        mThread.start();
    
public booleanonSurfaceTextureDestroyed(android.graphics.SurfaceTexture surface)

        if (mThread != null) mThread.stopRendering();
        return true;
    
public voidonSurfaceTextureSizeChanged(android.graphics.SurfaceTexture surface, int width, int height)

        // Ignored
    
public voidonSurfaceTextureUpdated(android.graphics.SurfaceTexture surface)

        // Ignored