I need to take more photos, but the app restarts on Android 11 devices. Android 10 or lower is OK. It behaves enigmatic. Sometimes it happens after third capturing, sometimes maybe after seventh capturing.
Simulation of the problem (restart after second capturing):
- Click Button for take a picture
- Take a picture
- Click OK
- App returns to the screen with button
- Steps 1-3
- App restarts and displays the home screen
If I place a breakpoint on var photo = await MediaPicker.CapturePhotoAsync();
and go to next step, nothing gets done and app crashes.
This also happens in App-Essentials Sample App.
Edit: My code:
var file = await MediaPicker.CapturePhotoAsync();
while (LS.IsIntermediateActivity())
{ await Task.Delay(10); }
Normal behaviour: capture photo, click OK, next step - while (LS.IsIntermediateActivity()) and then in MainActivity OnRestart and OnResume. (LS is DependencyService)
Incorrect behaviour: capture photo, click OK, no next step - app crash or restart and show MainPage. No Exception, no warning.