Android Question Camera2 - Problem with Camera_SurfaceReady

Discussion in 'Android Questions' started by Steve Addy, Feb 20, 2019.

  1. Steve Addy

    Steve Addy Member Licensed User

    I'm writing a timelapse app using a foreground service to keep the process running and all is fine until the display "goes to sleep".

    When the Main Activity is re-awakened by a CallSubDelayed from my foreground service, there is no response from the line "Wait For Camera_SurfaceReady" in "Private Sub CreateSurface" in CamEX2

    Is there any solution for this problem when the display has gone to sleep?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Run the Camera2 example. Click on the home button and then back to the app. Does the camera work?
     
  3. Steve Addy

    Steve Addy Member Licensed User

    Camera2 worked okay.
    I solved my timelapse app problem by setting PhoneWakeState.KeepAlive in Main.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice