# Automatically closing xr session when application is closed

**URL:** <https://forum.babylonjs.com/t/automatically-closing-xr-session-when-application-is-closed/23848>\
**Category:** Questions\
**Tags:** react, webxr\
**Created:** [September 15, 2021, 9:45am UTC](https://forum.babylonjs.com/t/automatically-closing-xr-session-when-application-is-closed/23848 "2021-09-15T09:45:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 15, 2021, 3:11pm UTC](https://forum.babylonjs.com/t/automatically-closing-xr-session-when-application-is-closed/23848/5 "2021-09-15T15:11:12Z")

</div>

I’m actively working on something related :

> [@BabylonNative - Is it possible to restart an Android activity?](https://forum.babylonjs.com/t/babylonnative-is-it-possible-to-restart-an-android-activity/23542/38):
>
> I moved engine shutdown in main activity. I get no more crash with multiple back and forth between main & playground activities. PR is in sync with my latest changes.

Can you check how it goes with this Babylon Native branch?

> **[GitHub - CedricGuillemet/BabylonNative at test/Android\_lifecycle\_activities](https://github.com/CedricGuillemet/BabylonNative/tree/test/Android_lifecycle_activities)**
>
> test/Android\_lifecycle\_activities

I think the crash cause is the same.

---

_[View the full topic](https://forum.babylonjs.com/t/automatically-closing-xr-session-when-application-is-closed/23848)._
