Want App to temporarily hide navigation bar

My APP uses the system clock to accurately time events happening in real time over the fixed period of a particular activity. When the APP user observes the start or end of an event, the user presses an appropriate button that records either the start time or end time of the event. There is a variety of events.
Under user control, the APP computes,records and displays the real time periods covering events as they happen during the activity. Normally the APP's navigation bar is visible. However, I observe that if the back button bar is pressed at any time while the APP is running, the APP is moved to the background (but not deleted) and, when restored, I find that all the recorded timings have been lost and the app has returned to its initial, just loaded state.
If the Recents or Home button is pressed, the App moves to the background, but when restored, the timings are preserved and the app has continued in the state that it was in and all that is lost is what happened during its accidental pause. I therefore want to prevent accidental pressing of the back button and hence accidental wiping of the timings and hence loss of the real time data and the failure of coverage of that particular, as yet uncompleted, activity. The activity is out of the control of the app user and cannot be restarted.
Is there a way to get the app to make the navigation bar invisible for the period of running of the app, so that accidental pressing of the back button can be avoided?
Alternatively, can one program the APP to intercept the pressing of the Back button and to query it and give the user the opportunity to confirm or deny its use ( and possibly switch it to the Recent or Home button use)?

Screen1 has a Back Button Clicked event where you can intercept that.

You might also consider saving timing data to TinyDB as it occurs.

Thanks for your intercept suggestion. I will try that. There is too much detailed status data to consider the TinydB suggestion.