Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Restarting my Application?
Started by tonyxdoan May 01 2019 12:28 PM

4 replies to this topic
refresh reload restart relaunch
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tonyxdoan

[GLOBAL: userInfoPane.html]
tonyxdoan
  • Observer

  • 3 posts
  • Corona SDK

Hi! 

 

I am encountering an error in other parts of my application whenever I click on this specific area in my app. A solution I found that made the application run normally again was to just kill the app (something along the lines of double tapping the home button and then swiping the app off screen), then starting the application up again. Evidently, this is a short term solution to the problem, but I'm hoping to have a solution in the meantime while I work on finding where the problem lies. 

 

So my question: Is there a way to "restart" the application that has a similar effect of closing the app and opening up again, or somethings that's similar to the "relaunch" function in the Corona Simulator? I've seen os.exit(), which kills the app, but it's not a restart and only does half the job. I've also been looking at scene:destroy() then goto another scene, but I'm not sure if that would have the same effect as what I'm looking for. 

 

Thanks!  



[TOPIC: post.html]
#2

tonyxdoan

[GLOBAL: userInfoPane.html]
tonyxdoan
  • Observer

  • 3 posts
  • Corona SDK

bump



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,922 posts
  • Enterprise

iOS apps are not supposed to exit. While testing, you can use os.exit() but Apple will reject your app if you allow your app to exit.

 

If you're using the Corona Simulator to copy your update to your device, it will shutdown and cold start your app for you.

 

Rob



[TOPIC: post.html]
#4

tonyxdoan

[GLOBAL: userInfoPane.html]
tonyxdoan
  • Observer

  • 3 posts
  • Corona SDK

Thanks for the reply Rob.

 

This is only an Android problem, so iOS won't be affected if I do make any changes. 

 

I'm aware that updating info within my code will restart the simulator, but I was wondering if there was a method to restart the application for Android devices once it's already built and running on an actual device. 



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,922 posts
  • Enterprise

That's what "Live Builds" are for. Simply tick the box on the build screen, then after that, as long as your device is on the same local network as your computer, it should cause the app to restart on your device just like saving does to the simulator.

 

http://docs.coronalabs.com/guide/distribution/liveBuild/index.html

 

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: refresh, reload, restart, relaunch