Code example for PagerAdapter

Methods: saveState

0
 
    @Override 
    public final Parcelable
    saveState() { 
        Bundle data = new Bundle();
        data.putParcelable(KEY_PARENT_STATE, super.saveState());
        onSaveInstanceState(data);
        return data;
    } 
 
    @Override 
    public final void 
    restoreState(Parcelable state, ClassLoader loader) {
        Bundle data = (Bundle)state;
        super.restoreState((null == data)? null: data.getParcelable(KEY_PARENT_STATE), loader);
        onRestoreInstanceState(data);
    } 
}