In my app I'm taking pictures like this:
public void OpenCam()
{
// Standard
Intent intent = new Intent(MediaStore.ActionImageCapture);
_newFile = new Java.IO.File(Storage.Instance.TmpImageFilePath);
intent.PutExtra(MediaStore.ExtraOutput,
FileProvider.GetUriForFile(Context, Context.PackageName + ".provider", _newFile));
intent.AddFlags(ActivityFlags.GrantReadUriPermission);
StartActivityForResult(intent, TakeImageRequest);
}
after taking a picture and and confirm the taken picture with ✓ in the photo app, OnActivityResult is called and I can work with the data.
This worked fine for a few years.
Now, on my Samsung Galaxy Tab7 FE - Android 12, every ~third attempt fails. The app crashes on clicking the round button to take a picture (that's the moment when the Visual Studio debugger stops). No error, no exception, OnActivityResult is not called.
logcat
: (orange marked is my app package name)
and right before:
06-03 09:06:33.670 Samsung SM-T733 Info 1200 ActivityManager Process MYAPP (pid 28306) has died: prev LAST(511,287)
Edit: Devices I could test without this problem:
- Huawei P30 lite (Android 8)
- Huawei P30 Pro ( Android 10)
- Samsung A52s 5G (Android 12)
- Huawei Mediapad M5 lite (Android 8)