Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

Prevent an app from going to sleep/crashing when handing off the Immersive device to another user

I have had an issue for a while where we would like to demo an app on the immersive device and would like to start the user already in the app, maybe after some menus have been navigated. However, often the app will just close when I remove the headset and the other user puts it on, or it might be stuck on the black screen which is basically the equivalent of crashing.

How do I prevent this, especially given how inconsistent it is and the same app might perform this handoff behavior just fine in testing but will fail on later attempts? I have looked into a number of solutions including enabling the run in background setting in unity and the extended execution session for uwp, none of which seem to fix the issue.

any help would be appreciated.

Best Answer

Answers

  • In my side, it works well. Could you use a sample in MRTK to reproduce your issue?

  • nyt_Rushnyt_Rush
    edited September 2018

    @EricWilson @MRFan Hi, I am new hololens devlopement..even I am trying to run the app in the background...were you able to solve this issue.
    How did you implement extended execution in unity solution even I want to try this approach..could you please guide me about it?

  • Accepted Answer

    @nyt_Rush there is a run in background option in the player settings in unity. if that doesn't work you can take a look at the docs for https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution.

    I was never able to get my desired result through code however. In order to prevent the app from returning to the menu, we blocked the sensor in the headset that determines if a user is wearing the headset. This way, it is not able to exit an app when handoff occurs.

  • nyt_Rushnyt_Rush
    edited September 2018

    @EricWilson said:
    @nyt_Rush there is a run in background option in the player settings in unity. if that doesn't work you can take a look at the docs for https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution.

    I was never able to get my desired result through code however. In order to prevent the app from returning to the menu, we blocked the sensor in the headset that determines if a user is wearing the headset. This way, it is not able to exit an app when handoff occurs.

    Hi @EricWilson ,

    Thanks, for the prompt reply, how did you block the sensor is there any internal API built for this sort of behavior?

  • @nyt_Rush Not as far as I know, unfortunately. We went with a simpler option and decided to put a sticky note over the sensor to prevent it from detecting distance.

Sign In or Register to comment.