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

  • Home
  • SEARCH
  • 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 4617446
In Process

The Archive Base Latest Questions

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

I am using pretty much the same code as the Camera app code from

  • 0

I am using pretty much the same code as the Camera app code from Google but am getting really weird results. Inside my application and the Camera app from Google the preview gets stuck or is overlid with weird lines. The preview is usually the last thing which I see in the phone’s own Camera app.

The Samsung model is I9003. The same code ran fine on I9000 which Samsung just discontinued. The code also works fine on an HTC Wildfire.

Any resolution for this?


Just noticed that after taking a photo inside my application the camera preview becomes normal. Same thing is happening in the Google camera application.

  • 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-22T02:07:32+00:00Added an answer on May 22, 2026 at 2:07 am

    Couldn’t post the answer earlier. Wasn’t sure if it was the right thing to do, but now with the app running properly on around 150 devices I guess this works.

    So the Android camera app in its onCreate function had the following code:

             /*
             * To reduce startup time, we start the preview in another thread.
             * We make sure the preview is started at the end of onCreate.
             */
            Thread startPreviewThread = new Thread(new Runnable() {
                public void run() {
                    try {
                        mStartPreviewFail = false;
                        startPreview();
                    } catch (CameraHardwareException e) {
                        // In eng build, we throw the exception so that test tool
                        // can detect it and report it
                        if ("eng".equals(Build.TYPE)) {
                            throw new RuntimeException(e);
                        }
                        mStartPreviewFail = true;
                    }
                }
            });
            startPreviewThread.start();
    

    For some reason this did not work on GT-I9003. What I noticed was that after taking a photo the preview would come properly so there was nothing wrong with the hardware as such. I tried to retrace what was happening after a photo was taken and then compare it with the code with which the camera was first initialized. I commented out this code from onCreate. The onResume from the camera app looked like this:

    if (mSurfaceHolder != null) {
       // If first time initialization is not finished, put it in the
       // message queue.
       if (!mFirstTimeInitialized) {
          mHandler.sendEmptyMessage(FIRST_TIME_INIT);
       } else {
          initializeSecondTime();
       }
    }
    

    I changed this to:

            if (!mFirstTimeInitialized) {
                initializeFirstTime();
            } else {
                initializeSecondTime();
            }
    

    There were some other changes too, will put it up on GitHub as a separate app soon.

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

Sidebar

Related Questions

I am using pretty much the same code to load my UIViewController (called LessonScrollView)
I have pretty much tried everything but still have this same problem. I have
Using: http://simplehtmldom.sourceforge.net/ I'm comparing prices of pretty much the same products of different brands.
Currently i'm using pretty much Unix + Mysql + Perl + Apache with some
pretty much what the title says. I am using an Ajax Drop Down as
The title pretty much says it all. I'm using a TClientDataset to store an
I've been using Eclipse pretty regularly for several years now, but I admit to
I think I'm pretty good at using semantic markup on my pages but I
I'm getting something pretty strange going on when trying to read some data using
I got some code from java httpurlconnection cutting off html and I am pretty

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.