Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
- // Create a SparseArray just for us!
- SparseArray mySparseArray = new SparseArray(mChildrenCount + 1); // +1 for our ViewGroup's state.
- // Repeat the normal logic for this method, but pass our "mySparseArray" instead of "container"
- super.dispatchSaveInstanceState(mySparseArray);
- final int count = mChildrenCount;
- final View[] children = mChildren;
- for (int i = 0; i < count; i++) {
- View c = children[i];
- if ((c.mViewFlags & PARENT_SAVE_DISABLED_MASK) != PARENT_SAVE_DISABLED) {
- c.dispatchSaveInstanceState(mySparseArray);
- }
- }
- // Put mySparseArray in the container we were given.
- container.put(getId(), mySparseArray);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement