• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps onResume() / onPause Camera Problem

ciwolsey

Lurker
The camera preview in my app crashes if I push the back button to leave my app. I have tried to do exactly as the documentation says. It also doesn't resume the preview upon returning from sleep, it just shows a frozen image.

You can see my code here: Your code. Your site. Use it. - paste.org
The logcat output is at the bottom

Any help would be really appreciated as I'm at a dead end now.

Thanks

ciwolsey
 
Obviously the

Code:
camera.stopPreview();

is called after the

Code:
camera.release();

Try to move the stopPreview() call just before the release() call in the onPause method.
 
Back
Top Bottom