Created
October 30, 2019 06:12
-
-
Save BurningDroid/ea8e6eefe2893e81f75d87516213e6b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onViewStateRestored(@Nullable Bundle savedInstanceState) { | |
super.onViewStateRestored(savedInstanceState); | |
if (savedInstanceState != null) { | |
mLayoutManagerSavedState = savedInstanceState.getParcelable("key"); | |
} | |
} | |
@Override | |
public void onStart() { | |
super.onStart(); | |
if (getArguments() != null) { | |
mDataArray = getArguments().getParcelableArrayList("key_datas"); | |
mAdapter = new MyAdapter(mDataArray, getContext()); | |
mRecyclerView.setAdapter(mAdapter); | |
if (mLayoutManagerSavedState != null) { | |
mRecycleriew.getLayoutManager().onRestoreInstanceState(mLayoutManagerSavedState); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment