@Test public void testWriteToParcel() { final Parcel parcel = Parcel.obtain(); final TestState savedState = new TestState(TestState.EMPTY_STATE); savedState.count = 10; savedState.writeToParcel(parcel, 0); parcel.setDataPosition(0); assertThat(parcel.readParcelable(TestState.class.getClassLoader()), is(nullValue())); assertThat(parcel.readInt(), is(10)); parcel.recycle(); }
@Override public void writeToParcel(@NonNull final Parcel dest, final int flags) { dest.writeParcelable(superState, flags); }
AdapterSavedState implements Parcelable { @Override public void writeToParcel(@NonNull final Parcel dest, final int flags) { dest.writeParcelable(superState, flags); } }
AdapterSavedState implements Parcelable { @Override public void writeToParcel(@NonNull final Parcel dest, final int flags) { dest.writeParcelable(superState, flags); } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); }
AdapterSavedState implements Parcelable { @Override public void writeToParcel(@NonNull final Parcel dest, final int flags) { dest.writeParcelable(superState, flags); } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); @Override void writeToParcel(@NonNull final Parcel dest, final int flags); @NonNull final Parcelable getSuperState(); @Override int describeContents(); }
AdapterSavedState implements Parcelable { @Override public void writeToParcel(@NonNull final Parcel dest, final int flags) { dest.writeParcelable(superState, flags); } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); @Override void writeToParcel(@NonNull final Parcel dest, final int flags); @NonNull final Parcelable getSuperState(); @Override int describeContents(); static final AdapterSavedState EMPTY_STATE; static final Creator<AdapterSavedState> CREATOR; }