Camera freeze issue when locking screen

#1

While playing around with the code snippets in the chapter it seems like whenever the screen is locked, then resuming again, the camera preview stays frozen. I double checked that my code matches the sample code, everything looks good. I also verified on two devices (Samsung Galaxy S3 & HTC Inspire). Also verified that the onResume and onPause callbacks are getting invoked while leaving/entering the lock screen.

The weird part is that it works correctly when I hit the home button then come back to the app. The issue is only reproducible when I go to the lock screen then come back. Any ideas? Thanks :mrgreen:

#2

Thanks for the reply :wink:

#3

Urk!

I’ve had this one sitting in my queue for a while. I apologize for not getting back to you promptly.

I’m unable to verify the issue at the moment - does the solution behave similarly for you?

#4

[quote=“jon4thangarcia”]While playing around with the code snippets in the chapter it seems like whenever the screen is locked, then resuming again, the camera preview stays frozen. I double checked that my code matches the sample code, everything looks good. I also verified on two devices (Samsung Galaxy S3 & HTC Inspire). Also verified that the onResume and onPause callbacks are getting invoked while leaving/entering the lock screen.

The weird part is that it works correctly when I hit the home button then come back to the app. The issue is only reproducible when I go to the lock screen then come back. Any ideas? Thanks :mrgreen:[/quote]

i have the same question, because, i set the activity portrait, when i press the power button, it only get onpause and onresume, so the surfaceview has not got onsurfacecreate and onsurfacechanged.