instancestate

Overriding onSaveInstanceState

孤者浪人 提交于 2020-02-02 10:59:25
问题 I'm trying to come to grips with the onSaveInstanceState method in class View (not the one in class Activity). That method does return a Parcelable. I derived my own View from ViewGroup and overrode that method to save my own state. But when the state was to be saved I got an exception: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() That is true enough, but simply calling that method doesn't seem enough to me. So how should I do this? If the method

Overriding onSaveInstanceState

让人想犯罪 __ 提交于 2020-02-02 10:57:10
问题 I'm trying to come to grips with the onSaveInstanceState method in class View (not the one in class Activity). That method does return a Parcelable. I derived my own View from ViewGroup and overrode that method to save my own state. But when the state was to be saved I got an exception: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() That is true enough, but simply calling that method doesn't seem enough to me. So how should I do this? If the method

Overriding onSaveInstanceState

僤鯓⒐⒋嵵緔 提交于 2019-12-06 13:14:06
I'm trying to come to grips with the onSaveInstanceState method in class View (not the one in class Activity ). That method does return a Parcelable . I derived my own View from ViewGroup and overrode that method to save my own state. But when the state was to be saved I got an exception: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() That is true enough, but simply calling that method doesn't seem enough to me. So how should I do this? If the method would get passed a Parcel to write to, I could simply pass that same parcel to the super class, so