How to initialize a new Camera.Size in Android

android

Solution

Actually, a slightly different syntax is required:

Camera camera = Camera.open();
Camera.Size size = camera.new Size(width, height);

Problem

For example: ``` int width = 720; int height = 1280; ``` I want to create a Camera.Size. ``` Camera.Size size = new Camera.Size(width,height); ``` But it has some error. ``` 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). ```

Original source