- Home /
Resuming Application on Android
Hi everyone !
I'm trying to implement Pausing in Unity by using OnApplicationPause function.
It seems to work fine when I exit my game (on Android) by pressing home button and then comeback through list of active apps, but when I press the game icon on home screen, it restart the game instead of bringing me back.
Is there any way around this ?
Answer by tezt · Feb 19, 2014 at 09:15 PM
I just found the reason which causes such a behaviour. It is one of the plugins I'm using (Admob plugin). Because it overrides AndroidManifest.xml it also affects behaviour of application. Although, I still don't know how to fix it...
Answer by Ed unity · Feb 19, 2014 at 03:52 PM
Your game should be returning to where it was paused so long as it has not been too long since the last time the app was paused. You can read in OnApplicationPause(bool isPaused) to see if the application is currently paused or it has returned. Typically the application does not restart unless you load in your original scene. You should place code in your application to keep the timescale at 0 even after the game returns so that you can tell if the application is returning and then reloading or if the application is restarting all together.
Your answer
Follow this Question
Related Questions
Scene not loading properly on android device? 0 Answers
Simple Android project shuts down when user presses the Recent Apps button 1 Answer
Restart Game button for android mobile Phone help? 1 Answer
Restart your Application via Script 1 Answer
Unity 5: PlayerPrefs/Application data resets Graphics on Android device 0 Answers