Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
slingxshot
Level 7

Restart Application

I have a logout button, and I want to restart application, possibly go back all the way to main.brs... anyway to reload the app or reload the scene?

Thanks!
0 Kudos
3 Replies
slingxshot
Level 7

Re: Restart Application

Doesn't seem to be a good way to restart application. The scenes just go on top, and trying closing the scene, exits the app or causes errors. There is probably a way so not worth. Instead I just exit the app and let the user go back in.

https://github.com/rymawby/roku-app-exit
0 Kudos
gabek
Level 7

Re: Restart Application

  appId = createObject("roAppInfo").getID()
  url = substitute("http://localhost:8060/launch/{0}?restart=true", appId)
  launchRequest = createObject("roUrlTransfer")
  launchRequest.setUrl(url)
  launchRequest.postFromString("")

It's probably not everybody's cup of tea, but in the most literal sense this will actually restart your application as opposed to other approaches where you try to clean up state and reload your SceneGraph components.
0 Kudos
slingxshot
Level 7

Re: Restart Application

Oh man I wish i saw this earlier. This helps me a lot, solves 2 problems at once. I wanted to have authentication completed separate from the main app and this allows me after authentication restart the app and reset all settings with the registry, etc. Thank You!
0 Kudos