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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Hi, i found an odd API here. When I found AA has supported @InstanceState, I was happy that I don't have to write custom parcelable again. But, it doesn't work like what I expected.
As you can see here I'm saving view states (background, checked state) on @InstanceState.
or we could just move the super.onRestoreInstanceState(instanceState); method to be called last. so that first the generated class restores its state and then we are calling into the parent.
Activity
dodgex commentedon Feb 27, 2017
Not sure what you mean? can you post some more code? in what class do you use
@InstanceStateand from what class is the generated code?yolapop commentedon Feb 27, 2017
@dodgex
in this case I want to re-check the item based on what is restored
but the custom view is not notified after
onRestoreInstanceStateis called so I don't know how to re-check the view.dodgex commentedon Feb 27, 2017
ah okay so your issue is that you get the values but you don't get a notifications when the state is set.
looks like we need some kind of
@AfterInstanceStateor something similar. @WonderCsabo wdyt?dodgex commentedon Feb 27, 2017
or we could just move the
super.onRestoreInstanceState(instanceState);method to be called last. so that first the generated class restores its state and then we are calling into the parent.dodgex commentedon Mar 7, 2017
I have openend a PR to move the
super.onRestoreInstanceState(instanceState);call below the state restorationsyolapop commentedon Mar 20, 2017
thank you