You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change orientation to landscape and back to portrait
Swipe to fragment B --> crash
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.Collection.iterator()' on a null object reference
at java.util.AbstractCollection.addAll(AbstractCollection.java:74)
at java.util.TreeSet.addAll(TreeSet.java:132)
at java.util.Collections$SynchronizedCollection.addAll(Collections.java:390)
at eu.davidea.flexibleadapter.SelectableAdapter.onRestoreInstanceState(SelectableAdapter.java:577)
at eu.davidea.flexibleadapter.FlexibleAdapter.onRestoreInstanceState(FlexibleAdapter.java:5106)
And the trace looks like this:
> onSaveInstanceState FLEX_ADAPTER
SAVE FLEX_ADAPTER STATE
> onSaveInstanceState FLEX_ADAPTER
> RESTORE FLEX_ADAPTER STATE
So, saving and restoring do go out of synch!
It's possible to work around this problem by saving e.g. boolean flag to bundle in onSaveInstanceState and read it in onViewStateRestored before calling adapter.onRestoreInstanceState but could you consider checking if savedInstanceState.getIntegerArrayList(TAG) is null like mentioned in #611
The text was updated successfully, but these errors were encountered:
Hello,
I can still get the App crash in the setup I explained in #649
I create the adapter (with no items) in onActivityCreated and my code for saving/restoring the state looks like this:
To reproduce the error I follow these steps:
And the trace looks like this:
So, saving and restoring do go out of synch!
It's possible to work around this problem by saving e.g. boolean flag to bundle in onSaveInstanceState and read it in onViewStateRestored before calling
adapter.onRestoreInstanceState
but could you consider checking ifsavedInstanceState.getIntegerArrayList(TAG)
is null like mentioned in #611The text was updated successfully, but these errors were encountered: