Issue
Most built-in widgets restore its state on configuration change.
But now I have a situation when I want to disable this feature.
I set a particular view some value during onCreate() call and it's been changed during onRestoreInstanceState() if the device was rotated.
I could reset it after onRestoreInstanceState(), but maybe there's another way to do it.
Solution
You can add android:saveEnabled="false" to the View (or call setSaveEnabled(false) programmatically). The View will still be recreated on a configuration change, though -- it just won't save and restore its own private state.
Answered By - Kevin Coppock
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.