Currently if the camera can't load (if there is no camera or a camera can't be resolved for the use case) an exception is given and AFAIK there is no way to catch the error.
The previous code throws the following exception on the Android 12L emulator: java.lang.IllegalArgumentException: Provided camera selector unable to resolve a camera for the given use case.
Proposal
Allow to build a widget from .when on OnErrorMode that catches exceptions.
Look at the following code:
Currently if the camera can't load (if there is no camera or a camera can't be resolved for the use case) an exception is given and AFAIK there is no way to catch the error.
The previous code throws the following exception on the Android 12L emulator:
java.lang.IllegalArgumentException: Provided camera selector unable to resolve a camera for the given use case
.Proposal
Allow to build a widget from
.when
onOnErrorMode
that catches exceptions.