Yes, copied and pasted into Patients with the other Activity_Keypress commented out.
It seems to work OK in release, but when coming to the foreground it's going directly to the Patients activity, so I think the 'Killing Instance (Main)' thing is not happening (for now, it comes and goes).
In debug, I can see it is doing 'Killing Instance (Main)' and after that, that back button is not intercepted.
I've put a breakpoint on it, the picture shows no BP hit when I press back button (I took the screenshot 5 seconds after pressig BACK). Everything just locks up for a few seconds, nothing arrives in the Log and after a minute or 2 android kills the app.
The only strategy that seems to be working for me is to add "SetActivityAttribute(main, android:launchMode, "singleInstance")" to the manifest (this seems to stop the 'Killing Instance(Main)' thing from happening, and adding this code to track what activity was active, so I can restore the right activity from within Main after the app icon is pressed
If Global.LastActivity = "patients" Then
If IsPaused("Patients") = True Then
StartActivity(Patients)
End If
Else If Global.LastActivity = "calib" Then
If IsPaused("Calib") = True Then
StartActivity(Calib)
End If
Else If ...
If there is no inherent danger in adding that line to the manifest, I think I'll just have to proceed with that. I'll be testing it with all my other tablets and different OS versions this afternoon, hopefully it works solidly on all of them.