The built in dialogs (like console.input_alert, raw_input, camera input dialogs, etc) need to be run in a background thread, though in 1.5 at least, there were some cases where in_background didn't work... possibly because of the fact that everything which uses in_background shares the same queue. I think there was some tuning of priorities in 1.6 (your code worked okay for me, but perhaps we need to see the entire app)
Using ui.delay is a simple way to spawn a new independent thread, without having to learn about the threading module. You would do something like
def scan_document(self, sender): def show(): img = photos.capture_image() console.show_activity() if not img: return with io.BytesIO() as bIO: img.save(bIO, 'PNG') imgOut = ui.Image.from_data # actually DO something with the image ui.delay(show,0.1)if that still doesn't work, try first closing the view, before the ui.delay, then increase the delay time to a second or so, to give the view time to minimize. at the end of show you could represent the top level view. Again, i did not have to do any of this in 1.6, but sometimes such things were needed in 1.5.