Created
July 16, 2015 00:32
-
-
Save skyisle/a553f1c64e4611d10bd8 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
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