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 847587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:48:27+00:00 2026-05-15T06:48:27+00:00

As part of my widget, I use an instance of the Camera object. This

  • 0

As part of my widget, I use an instance of the Camera object.

This is what I want to do. The user will click on my widget, I get an instance of the Camera(if it’s not already stored), use it, then store it. If they click the widget again, I want to use that same instance that I used previously.

Is this possible?

EDITED: I can’t release the Camera(android.hardware.Camera) until the user clicks on the widget the second time. So the user clicks on the widget the first time, I get the camera and hold on to it until they click the widget again.

The problem I am running into is on the second click, I am trying to get the Camera again, which I can’t because I currently have it in use.

  • 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-15T06:48:28+00:00Added an answer on May 15, 2026 at 6:48 am

    Ok, so I figured this out, I think.

    If I make a static class object for the widget class, it seems to keep it in memory.

    private static Camera camera = null;

    Then setting it in code..

    camera = Camera.open();

    does seem to keep it in memory for use later. I don’t know if that’s really inefficient or not, but that’s the only way I could get it to work.

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

Sidebar

Related Questions

I use this grid to view a table with data: View part: <?php $this->widget('zii.widgets.grid.CGridView',
Part of my code I get the OuterHTML propery <LI onclick=TabClicked(this, 'SearchName', 'TabGroup1');>Name so
I want to display only part of image using the GWT Image widget; for
When passing an object called widget as part of the context to rendering a
I´m making a widget app and I want a part of it update once
I have a widget that is a part of my main app. Usually when
Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I wrote a widget like this: public class GroupLbl extends Composite implements ClickHandler, MouseOutHandler
I don't use any ORM for entities. This form is built for sending email
Part of our core product is a website CMS which makes use of various

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.