Home | History | Annotate | Download | only in shadows
      1 package org.robolectric.shadows;
      2 
      3 import android.os.Parcel;
      4 import android.os.Parcelable;
      5 
      6 class TestParcelable implements Parcelable {
      7   int contents;
      8 
      9   public TestParcelable(int contents) {
     10     this.contents = contents;
     11   }
     12 
     13   @Override
     14   public int describeContents() {
     15     return 0;
     16   }
     17 
     18   public static final Creator<TestParcelable> CREATOR =
     19       new Creator<TestParcelable>() {
     20         @Override
     21         public TestParcelable createFromParcel(Parcel source) {
     22           return new TestParcelable(source.readInt());
     23         }
     24 
     25         @Override
     26         public TestParcelable[] newArray(int size) {
     27           return new TestParcelable[0];
     28         }
     29       };
     30   @Override
     31   public void writeToParcel(Parcel dest, int flags) {
     32     dest.writeInt(contents);
     33   }
     34 }
     35