I've displayed a camera stream using TextureView. When switching camera (stopPreview() called before switching), front-to-back or vice-versa, the view paused at the last frame drawn on the TextureView. I want to display a blank screen while the "switching" is happening. How can I achieve it?
The easiest solution is to define a black view that overlays your camera preview surface. Set it's visibility "gone" while camera preview is working, and "visible" when you stopPreview and until the switch is over. With the deprecated camera API you can use setPreviewCallbackOnce() to get the indication that it's time to hide the overlay again.