Code example for Parcel

Methods: writeValue

0
  public void writeToParcel(Parcel dest, int flags) {
    if (dest == null) {
      throw new RuntimeException("Parcel must not be null");
 
    } 
    dest.writeValue(type);
    dest.writeValue(contentUrl);
    dest.writeValue(contributor_name);
  } 
 
  private void readFromParcel(Parcel in) {
    final ClassLoader cl = getClass().getClassLoader();
 
    type = (String) in.readValue(cl);
    contentUrl = (String) in.readValue(cl);
    contributor_name = (String) in.readValue(cl);
 
  } 
 
}