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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:55:06+00:00 2026-06-18T23:55:06+00:00

I am trying to develop an Android app which interacts from Camera hardware to

  • 0

I am trying to develop an Android app which interacts from Camera hardware to record video. It records the video for 10 seconds, saves it and sends it to server(in background thread) and starts another video for next 10 seconds.It is expected to take videos indefinitely unless user presses the “stop” button in the app. Even if user presses home button then the video recording should continue in background.

Currently, if user presses the home button then the camera preview generates an exception as
“Java: IO Exception: Invalid preview surface”

Here is the code snippet I have used

 recorder.setOutputFile(outputFile+"_"+number+".mp4");
        recorder.setPreviewDisplay( holder.getSurface());
        if (recorder != null) {
            try {
                recorder.prepare();
                recorder.start();
            } catch (IllegalStateException e) {
                Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();

            } catch (IOException e) {
                Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
            }
        }

Can I continue recording in the background even when user presses the home key?

  • 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-18T23:55:07+00:00Added an answer on June 18, 2026 at 11:55 pm

    I don’t have any link documenting to this behavior, but I guess it’s not possible. Even though you use a Service, it keeps throwing exceptions saying that it has “lost the surface”.

    You can check this other question as well.

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

Sidebar

Related Questions

I am trying to develop an Android based application, which can play video from
I'm trying to develop an Android app. I'm developing in Eclipse which is running
I am trying to develop app, which records audio & playback.I am able to
I have been trying to develop an Android app which lets the user take
I am trying to develop an app in Android which can display information about
I was trying to develop an android app which contains a pie chart. I
Based on GeoTweet example from Sencha, I am trying to develop an Android App
I am trying to develop an android application that will stream the video from
i am trying to develop an android app (named ContactListFinder) which follows the following
I am trying develop an Android app which uses Google maps. So for the

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.