-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Inactivity crash #1
Comments
Yeah, also got the same issue: |
how did you fix it? |
I had same problem.. The reason of the problem is that, Android system start killing activities whenever there is shortage of memory, you need to save your data in onSavedInstanceState() and restore it whenever Activity/Fragment is recreated, either in onCreate or onRestoreInstanceState().. The reason why your application crashed is that, mScrollTabHolders contains SparseArrayCompat of fragments which is not saved in onSavedInstanceState() so after restore it turns out to be null and your application throws a null pointer exception.. In order to fix this crash Instead of using an activity for ViewPager, I used activity with a fragment and moved viewPager to that fragment. Make sure you save your data in onSavedInstanceState() for recreating your fragment.. |
After leaving the app in the background for a long while, you will get a crash when changing tab and and the header wont scroll...
The text was updated successfully, but these errors were encountered: