-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak on Android when Orientation Changes #170
Comments
Just found this it might be useful |
Use the following attribute to prevent the activity being recreated on an [Activity(ConfigurationChanges=Orientation)] This will then call Activity.OnConfigurationChanged when the orientation Sly On 15 December 2011 05:32, Dean Ellis <
|
Good find, ill give that a go today
|
that seems to work, but we now have to update the Viewport manually with the new width and height because the game is not being re-created each time. Looking at sorting that out now. |
There seems to be a big problem with the Orientation change stuff on Android. After reading the documentation the Activity is re-created each time the Orientation/Configuration changes. The means the Game object is being re-created each time, so all the assets are loaded again and again and again each time the orientation changes.
We need to figure out a way to detect this and keep the same game object/ content manager around and just swap out the Activity/ AndroidGameView.
This will not effect people who just use a fixed screen orientation for games as the orientation will not change. however this might be the cause of the Resume issue we have been seeing as well.
The text was updated successfully, but these errors were encountered: