Skip to main content
Inspiring
March 31, 2016
Solved

[Gear VR] How to shut down app on exit to the Store ?

  • March 31, 2016
  • 25 replies
  • 8323 views
When I use OVRQUITMENU or exit to Oculus Home from Universal Menu, shouldn't the app/game shut down automatically ?

If it should - then it's a bug. If not, what do I need to do to shut it down?

If I do nothing, then when I get the phone out if Gear VR, the app is still running in the background. When using Gear VR, it takes away memory and processing power that could be utilized by another Gear VR app/game.

Thanks.
    This topic has been closed for replies.
    Best answer by vrdaveb
    Yes, short-press brings up the confirm quit menu and if you confirm quit, then it should quit the app and take you to home. If that isn't happening, it would be a bug. We need a lot more information about the problem. What app is having the problem? What hardware and versions of UE4, the integration, Android, and SystemActivities are you using? Can you provide complete logcat from a failing run?

    25 replies

    Up and Coming
    April 8, 2016
    So, the list where you see the 'ghost app' is called 'recently used apps' list and it just shows the list of recently used apps. To make sure your app is not in memory you may use 'top' command in 'adb shell'. 

    Alternatively, you can exclude your app from appearing in the recently used apps list. You need to add android:excludeFromRecents="true" attribute to <activity> section in AndroidManifest.xml. In UE4, just go to 'Project Settings' -> 'Platforms' -> 'Android' -> 'Advanced APK packaging' and add the android:excludeFromRecents="true" line into 'Extra tags for UE4.GameActivity <activity> node'. Re-package and re-deploy.
    motorsepAuthor
    Inspiring
    April 13, 2016
    Alright, I followed Artyom's guidelines and it works as expected - the app is not in memory when exiting to Oculus Store \o/
    New Participant
    August 3, 2016
    What kind of log would we expect to see from unity to confirm that our app is exiting correctly?
    motorsepAuthor
    Inspiring
    August 3, 2016
    Same logcat output as with UE4
    Inspiring
    August 3, 2016
    08-03 14:49:00.111 31447 32438 I VrApi   : ---------- vrapi_LeaveVrMode [end] ----------
    ...
    08-03 14:49:00.431 31447 31447 I App_Android:     ANativeWindow_release( 0xee629a08 )
    ...
    08-03 14:49:16.881 31447 32438 D libEGL  : eglTerminate EGLDisplay = 0xf323ead4
    ...
    08-03 14:49:16.891 31447 31447 I VrApi   : ------------ vrapi_Shutdown -----------