例如:
int width = 720; int height = 1280;
我想创建一个Camera.Size.
Camera.Size size = new Camera.Size(width,height);
但它有一些错误.
No enclosing instance of type Camera is accessible. Must qualify the allocation with an enclosing instance of type Camera (e.g. x.new A() where x is an instance of Camera).
解决方法
实际上,需要稍微不同的语法:
Camera camera = Camera.open(); Camera.Size size = camera.new Size(width,height);