コード例 #1
0
 private void doRestoreState(Adapter adapter) {
   if (stateRestored || adapter == null || adapter.getItemCount() == 0) return;
   stateRestored = true;
   if (delayedState != null) {
     super.onRestoreInstanceState(delayedState);
     delayedState = null;
   }
 }
 @Override
 public void onRestoreInstanceState(Parcelable state) {
   SavedState ss = (SavedState) state;
   mPrevFirstVisiblePosition = ss.prevFirstVisiblePosition;
   mPrevFirstVisibleChildHeight = ss.prevFirstVisibleChildHeight;
   mPrevScrolledChildrenHeight = ss.prevScrolledChildrenHeight;
   mPrevScrollY = ss.prevScrollY;
   mScrollY = ss.scrollY;
   mChildrenHeights = ss.childrenHeights;
   super.onRestoreInstanceState(ss.getSuperState());
 }
コード例 #3
0
 @CallSuper
 @Override
 protected void onRestoreInstanceState(Parcelable state) {
   delayedState = state;
   super.onRestoreInstanceState(state);
 }