I am developing an Android app in Unity with Eclipse integration. I’ll try to describe it:
It has a “menu” scene. Basically, it’s a screen which prints “Loading” and waits for a parameter from eclipse. Depending on the parameter received, it loads a specific scene. In all other scenes, android back button was ignored by default, so I wrote code to capture the button press and quit application (it works fine). However, I’ve noticed that if I press the backbutton while “Loading” text is on screen (I have around 1-2 seconds to do that), application crashes. Moreover, I’ve noticed this also happens if I press the backbutton while on the default Unity splash screen, when execution hasn’t reached my code.
Does this issue related to this fact posted in changelog?: Android: Back button will quit the application while the first level has not yet been loaded.
Same problem here. Happens during a level load with LoadLevelAsync at the moment when the framerate drops to 0 when all our scene elements are getting instantiated.
Yeah, I’m using just normal LoadLevel and if you press the back button when its almost done loading, it will exit the app. Also exits if you double/triple tap the back button when returning to the app after being brought out to a browser window.
This has been happening ever since unity 4 came out. I’m surprised this problem isnt this getting more attention. Has nobody upgraded to unity 4 or something?
To get around this, you call PlayerPrefs.Save(), then force quit the app “Process.GetCurrentProcess().Kill()”.
When doing research for what I thought was a bug in my own code, I ended up finding out the best answer was there is a memory leak in Unity3D that DID NOT exist in Unity 4.1 and thus Androids main activity gets stuck… why Android can’t handle a memory leak correctly is beyond me, but not surprising either.