Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
motorsep's avatar
motorsep
Member
9 years ago
Solved

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

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? ...
  • vrdaveb's avatar
    9 years ago
    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?
  • artyom17's avatar
    9 years ago
    Yeah, it seems working:
    D/UE4     (28611): [2016.04.07-01.59.59:261][64000]LogHMD: GearVR shutdown.
    D/UE4     (28611): [2016.04.07-01.59.59:307][64000]LogWindows: FAndroidMisc::RequestExit(1)

    Why do you think it doesn't exit? If you refer to the "ghost app" that you still see if you press the Tasks button on the phone, then I can say it is not a real app. If you select it, the app will be started from the beginning. I don't know why that 'ghost app' stays in the tasks, seems like this is how the System.exit(0) works on Android (see implementation of AndroidThunkJava_ForceQuit() in Engine\Build\Android\Java\src\com\epicgames\ue4\GameActivity.java
  • artyom17's avatar
    9 years ago
    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.