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

Resuming app causes the Players tab to not show its ListView #2

Closed
hgzimmerman opened this issue Nov 29, 2015 · 1 comment
Closed
Assignees
Labels

Comments

@hgzimmerman
Copy link
Owner

This used to be more generally caused by the activity restarting (ctrl+shift+r in Android Studio) as well as when the app was closed. The activity restart error was fixed by adding "setRetainInstance(true) inside of the player fragment. This prevents the app from GCing the fragment when the activity restarts. The fragment (or its activity) is still GCed when left alone long enough in the background (probably due to Marshmallow aggressively suspending apps to save battery). For a quick fix, I should find a way to restart the app when it detects itself resuming.

@hgzimmerman hgzimmerman changed the title Resuming app causes the Players tab to not show it's ListView Resuming app causes the Players tab to not show its ListView Nov 29, 2015
@hgzimmerman hgzimmerman self-assigned this Nov 29, 2015
@hgzimmerman
Copy link
Owner Author

I seem to have fixed the problem by extending the FragmentStatePaerAdapter's saveState() method to return null, apparently preventing the app from doing something to the fragment when it tries to save.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant