Skip to content

Instantly share code, notes, and snippets.

@skyisle
Created July 16, 2015 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyisle/a553f1c64e4611d10bd8 to your computer and use it in GitHub Desktop.
Save skyisle/a553f1c64e4611d10bd8 to your computer and use it in GitHub Desktop.
public class DelayedRestorableListView extends ListView {
private Parcelable savedState;
public DelayedRestorableListView(Context context) {
super(context);
}
public DelayedRestorableListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public DelayedRestorableListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public void onRestoreInstanceState(Parcelable state) {
savedState = state;
super.onRestoreInstanceState(savedState);
}
public void restoreDelayedSavedState() {
if (savedState != null) {
super.onRestoreInstanceState(savedState);
savedState = null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment