Forum Archive

AssertionError: Cannot show camera from main UI thread

Webmaster4o

I'm getting this running my script. I think it has something to do with photos.capture_image triggered by a UI button. How do I get around this?

Note: If I do ui.load_ui().present() and then do photos.capture_image() on the next line, it works, I only get this error when it is button-triggered.

ccc

Try to see if the @ui.in_background decorator helps in this situation.

Webmaster4o

Thanks a ton.