Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

Conversation

Redth
Copy link
Member

@Redth Redth commented Sep 1, 2020

Description of Change

Stop recreating the app instance if the xamarin app's runtime is still active.

@Redth Redth requested a review from mattleibow September 1, 2020 14:51
@jamesmontemagno
Copy link
Collaborator

Interesting.... does this seem to be an issue in some places?

@Redth
Copy link
Member Author

Redth commented Sep 2, 2020

@jamesmontemagno so on Android, if you hit 'back' enough, your activity will be finished and destroyed, but the xamarin runtime will still be alive. What happens when you go back into the app is, you will get a new App() created even though you had a perfectly good one around before when you hit the back button. Using a static instance will reuse/share this Forms app instance. Think about the case where maybe you have a tabview and you were on the second tab, when you come back and the activity is recreated your App would get recreated and you'd lose your 'state' in a sense. With the static app instance you can retain this 'state'.

Hopefully that makes sense. This is probably largely unnecessary on the other platforms.

@jamesmontemagno
Copy link
Collaborator

fancy! <3

@Redth Redth merged commit 696928b into develop Sep 3, 2020
@Redth Redth deleted the sample-static-app branch September 3, 2020 17:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants