In Android, rotation of the phone restarts the app |
yaronct
|
A bit more research shows that when the orientation of the device changes, it sends an "SDL_QUIT" event. If, when receiving this event, I quit (by simply aborting the main loop in "main"), the application is restarted, and "main" is called again. If I ignore the "SDL_QUIT" event, the OS gets stuck. I still have no idea of to solve this.
|
|||||||||||
|
AntTheAlchemist
|
Did you solve this yet?
My Android app doesn't close when rotation changes. I get window resize events, but no SDL_QUIT event. SDL_QUIT will be produced if you close the window and don't create a new one. How are you handling window events? |
|||||||||||
|
In Android, rotation of the phone restarts the app |
Eric Wing
Guest
|
On 4/6/15, AntTheAlchemist wrote:
This sounds like you didn't put in the correct keys in your AndroidManifest.xml. By default, Android will restart your application every time there is a rotation, keyboard dismissal, screen size change, and maybe some other criteria. (I think it is shameful that they thought this is reasonable default behavior and still haven't fixed it.) android:configChanges="orientation|keyboardHidden|screenSize" -Eric Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
yaronct
|
Eric,
Thanx, this has solved my problem. Perhaps it would be best to change the "AndroidManifest.xml" that comes with SDL, as it doesn't contain the "screenSize". Or at least point that out in the SDL documentation for Android. |
|||||||||||
|
In Android, rotation of the phone restarts the app |
Bill Kendrick
Guest
|
On Mon, Apr 06, 2015 at 07:09:09PM -0700, Eric Wing wrote:
I remember a short intro demo about Android given at Google Summer of Code Mentor Summit, years ago, and everyone gasped when they told us that's how it worked. Kinda surprised it's still the case. I guess apps manage by having a UI separate from the rest of the app, or really fast state save/reload...? (Not an Android dev'er, if that's not obvious ) Still, I'm sure it's better than BREW. (Reasonable API, terrible implementations. ) -- -bill! Sent from my computer _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|