Forum Discussion

raxitpandya's avatar
raxitpandya
Channel Surfer
9 months ago

I want to show Exit dialog box in my app before user leave the app.

Hello 

I want to show Exit dialog box in my app before user leave the app. To resolve the issue, I have follow below link which has all the necessary steps to show dialog box. But in my case same code is not working. 

Link : https://medium.com/@amitdogra70512/confirmation-dialog-on-app-exit-in-roku-b305d91acec8

In my case, dialog box is not getting display and app close directly without waiting for dialog box.

Any suggestions and help are welcome.

Thank you.

 

5 Replies

  • ben9000's avatar
    ben9000
    Streaming Star

    The code provided in the medium blog link seems fine.

    Share what you have done to get help.

    • raxitpandya's avatar
      raxitpandya
      Channel Surfer

      I have used same code. There is no difference in my code for Exit dialog box. 

      • renojim's avatar
        renojim
        Community Streaming Expert

        I suggest you add print statements to the code to figure out what's going on.  I suspect the key press isn't getting to the onKeyEvent function in MainScene.brs.  For example, add:

        print key,press

        at the beginning of the onKeyEvent function and:

        print msgType

        in the event loop.  If you never see "back true" on the debug console you'll know the remote button press never made it to onKeyEvent.

        I've found peppering my code with prints is the best way to figure out what SceneGraph is doing.