open-ecosystem-development / OpenXR-SDK

Apache License 2.0
2 stars 3 forks source link

Android applications are not properly finalized #43

Open svillar opened 2 years ago

svillar commented 2 years ago

When the user clicks on the menu button of the 6DoF right controller the system proceeds to destroy the surface of the application. It then calls the methods

But it never calls onDestroy() as it should (see here).

The problem is that it is impossible for applications to know whether they have exited the security zone or whether they're being closed because the exact same sequence of methods is called. It's critical to differentiate both scenarios because in the former we just want to stop the application and wait for the user to reenter the security zone, but in the latter we have to free the application resources and exit.

So the solution here is to properly implement the Android Activity lifecycle and make the appropriate calls. Another option could be to fix #42 and let the application handle the shutdown by itself.