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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:07:33+00:00 2026-06-13T17:07:33+00:00

My camera app always gives an Exception when running on Android 2.x devices. On

  • 0

My camera app always gives an Exception when running on Android 2.x devices. On newer Android Devices, the app runs fine.

Stacktrace:

10-31 19:51:52.187: W/System.err(14904): java.lang.RuntimeException: startPreview failed
10-31 19:51:52.195: W/System.err(14904):    at android.hardware.Camera.startPreview(Native Method)
10-31 19:51:52.195: W/System.err(14904):    at com.example.MainActivity.startCamera(MainActivity.java:418)
10-31 19:51:52.195: W/System.err(14904):    at com.example.MainActivity.surfaceChanged(MainActivity.java:467)
10-31 19:51:52.195: W/System.err(14904):    at android.view.SurfaceView.updateWindow(SurfaceView.java:558)
10-31 19:51:52.195: W/System.err(14904):    at android.view.SurfaceView.dispatchDraw(SurfaceView.java:350)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.195: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-31 19:51:52.203: W/System.err(14904):    at android.view.View.draw(View.java:6883)
10-31 19:51:52.203: W/System.err(14904):    at android.widget.FrameLayout.draw(FrameLayout.java:357)
10-31 19:51:52.203: W/System.err(14904):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1964)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewRoot.draw(ViewRoot.java:1529)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1266)
10-31 19:51:52.203: W/System.err(14904):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1867)
10-31 19:51:52.203: W/System.err(14904):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-31 19:51:52.203: W/System.err(14904):    at android.os.Looper.loop(Looper.java:130)
10-31 19:51:52.203: W/System.err(14904):    at android.app.ActivityThread.main(ActivityThread.java:3687)
10-31 19:51:52.203: W/System.err(14904):    at java.lang.reflect.Method.invokeNative(Native Method)
10-31 19:51:52.203: W/System.err(14904):    at java.lang.reflect.Method.invoke(Method.java:507)
10-31 19:51:52.203: W/System.err(14904):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
10-31 19:51:52.203: W/System.err(14904):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
10-31 19:51:52.203: W/System.err(14904):    at dalvik.system.NativeStart.main(Native Method)
  • 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-06-13T17:07:34+00:00Added an answer on June 13, 2026 at 5:07 pm

    On your SurfaceView Holder, make sure to set the type to SURFACE_TYPE_PUSH_BUFFERS

    @Override
    public void onCreate(Bundle savedInstanceState) {
       // ...
       SurfaceView s=(SurfaceView)findViewById(R.id.surface);
       SurfaceHolder h=s.getHolder();
       h.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The system's camera app has a UI effect. After taking a photo, it will
I am working on android camera app,I want green screen chroma key effect to
I am working on android camera app,I want green screen chroma key effect to
Is it possible to start native android camera app that starts default camera instead
I'd like to add a menu option to the Android camera app. Is this
I was wondering how to tell android that my app is a camera app,
In camera.java, I need to get property in system. However, I can't import android.os.SystemProperties,
I managed to register my app as camera app via <activity android:name=.CameraActivity android:clearTaskOnLaunch=true> <intent-filter>
I am starting an android camera app for taking pictures. When I ctrl-shift-O to
I'm experiencing troubles issue with an android APP running into outOfMemory. After dig and

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.