Apparently, MIUI (the Xiaomi customised version of Android powering almost all Xiaomi devices) has a very aggressive memory management implementation causing any app in the background to be killed when the system finds that is using too much memory.
The Epicollect5 app goes in the background when taking photos because the stock camera app installed on the users' device will be in the foreground. After taking the photo, if the Epicollect5 app was killed while being in the background, the users will experience an app restart.
This is a known issue which is unfortunately outside of our control. The following steps can be taken to mitigate the problem until we are able to implement a definitive fix.
If Epicollect5 restarts despite having followed all the steps above, we would suggest installing the camera application called Open Camera (by Mark Harman) to be used as the default camera app for Epicollect5.