Create a Preview Use Case. |

This is a companion discussion topic for the original entry at

Hi @aldominium ,

Thanks for a great little preview, however the app keeps crashing if you close it and open it again a second time (it works fine on a fresh install, and allowing camera permissions).

The error is java.lang.IllegalStateException: textureView.display must not be null

So it turns out you need to add { bindCamera() } to the requestCameraPersmissionResult (it was previously just bindCamera()), if you have already accepted the permissions, the next time you restart the app, it seems it is trying to bindCameraupdateTextureView before the view is ready.