我正在尝试访问 Android 中的摄像头以获取实时视频。我正在尝试将我的内容视图设置为camera_surface
. 但是,Eclipse 给了我错误camera_surface cannot be resolved or is not a field
我的代码如下:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera_surface);
surfaceView = (SurfaceView) findViewById(R.id.surface_camera);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
谁能告诉我出了什么问题?