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

Prevent FormsAppCompatActivity from loading fragments we don't use on restart #246

Merged
merged 2 commits into from
Jul 18, 2016

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Jul 5, 2016

Description of Change

Prevent the FormsAppCompatActivity from attempting to restore fragments when being restored after being killed because of limited memory. Previously, the fragments were restored and then ignored by XF; in the case of nested fragments (e.g., a TabbedPage or MasterDetailPage containing another TabbedPage), this caused an IllegalStateException (followed by a crash) because a view could not be associated with the nested fragment. Now the FormsAppCompatActivity won't attempt to restore the fragments we weren't going to use anyway. (Bonus: slight memory improvement!)

Bugs Fixed

API Changes

None

Behavioral Changes

If a user is deliberately matching up and restoring fragments by tag when the application is restored, that user will have to derive from FormsAppCompatActivity and override the AllowFragmentRestore property to return true.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense

… restart

@samhouts
Copy link
Member

samhouts commented Jul 7, 2016

👍

@jassmith
Copy link

👍

@jassmith jassmith merged commit be9f626 into master Jul 18, 2016
@samhouts samhouts deleted the fix-bugzilla42075 branch July 19, 2016 01:37
@samhouts samhouts added this to the 2.3.2 milestone Jun 27, 2018
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.

5 participants