- Common ways to obtain SurfaceView
private void myMethod () {SurfaceView s =
Context context;new SurfaceView(context)
View view;(SurfaceView) view.findViewById(id)
ViewStub viewStub;(SurfaceView) viewStub.inflate()
- Smart code suggestions by Codota
}
private void initView() { surfaceHolder = svRecord.getHolder(); surfaceHolder.addCallback(this); //设置一些参数方便后面绘图 svRecord.setFocusable(true); svRecord.setKeepScreenOn(true); svRecord.setFocusableInTouchMode(true); pbRecord.setMax(100); pbRecord.setProgress(0); }
private void initView() { surfaceHolder = svRecord.getHolder(); surfaceHolder.addCallback(this); //设置一些参数方便后面绘图 svRecord.setFocusable(true); svRecord.setKeepScreenOn(true); svRecord.setFocusableInTouchMode(true); pbRecord.setMax(100); pbRecord.setProgress(0); }
cameraView.setFocusableInTouchMode(true); cameraView.setClickable(true); cameraView.setOnClickListener(this);
cameraView.setFocusableInTouchMode(true); cameraView.setClickable(true); cameraView.setOnClickListener(this);