Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7653685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:05:07+00:00 2026-05-31T12:05:07+00:00

For example (using android) if I want to declare a constant of a Camera.Size

  • 0

For example (using android) if I want to declare a constant of a Camera.Size class I have no apparent way of doing so. I’ve tried:

private static final Camera.Size CAMERA_SIZE = Camera.new Camera.Size(640, 480);

Obviously this didn’t work as you need to have an instance of a camera class to call ‘new’ with, like so:

Camera mCamera = Camera.open();
Camera.Size size = mCamera.new Size(640, 480);

But I can’t do that before before creating the constant. Is there any way around this or is it just impossible to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:05:08+00:00Added an answer on May 31, 2026 at 12:05 pm

    You can’t do that.

    Size is a nonstatic inner class of Camera. You can only create a Size within the enclosing class Camera; you cannot construct a new Camera.Size.

    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/android/hardware/Camera.java#Camera.Size

    Based on this, I’d say the API for this is written incorrectly. The constructor should have been private, or pkg private to make it clear that you cannot instantiate this class.

    You don’t say how you are trying to use it, but it looks like this is an object returned from various methods inside Camera. I don’t see where it’s ever passed into any method. Why do you need to construct it?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an example for compressing a string using GZip in android. I want
Does anyone have an example using the table object in YUI library. More specifically,
Given the following example (using JUnit with Hamcrest matchers): Map<String, Class<? extends Serializable>> expected
Let's have an example: using (var someObject = new SomeObject()) { var someOtherObject =
I have looked at this example using php and GD to piecewise-render a spiral
Usually I was doing something like that (just a example): using (Stream xmlStream =
I am doing one application using proximity sensor in android. when any object(finger) comes
I want to do a managedQuery using Android SDK where the results returned are
I have an app which I want to run on as many Android phones
I'm using an Android PopupWindow in an application so I want to be sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.