Code example for TextureView

Methods: setOpaquesetSurfaceTextureListener

0
        super.onCreate(savedInstanceState);
 
        FrameLayout content = new FrameLayout(this);
 
        // テクスチャビューを作成して設定 
        mTextureView = new TextureView(this);
        mTextureView.setSurfaceTextureListener(this);
         
        toggle = new ToggleButton(this);
        toggle.setTextOn("Set Alpha");
        toggle.setTextOff("Set Rotate");
        toggle.setChecked(false);
        toggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			 
			@Override 
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				mode = isChecked;
			} 
		}); 
         
        // 透過処理をtrue 
        mTextureView.setOpaque(true);
         
        // 500x500でViewを作成 
        content.addView(mTextureView, new FrameLayout.LayoutParams(500, 500, Gravity.CENTER));
        content.addView(toggle, new FrameLayout.LayoutParams(200,200, Gravity.TOP));
        setContentView(content);
Connect your IDE to all the code out there  Get Codota for Java