title: Implementing parcelable in a class to pass it from an activity to another
body: <p>i have class student
  i tried to use seriablizable but couldnt make it work... this didnt work too can any one find whats wrong with it?
  that uses class semester and Course in its variables take a look</p>
  
  <pre><code>public class Student implements Parcelable {
  private double GPA, MGPA;
  private LinkedList&lt;Course&gt; finishedcourses;
  private String username, password;
  private Semester semester;
  
  
  public Student(String user, String pass, double gpa, double mgpa,
          LinkedList&lt;Course&gt; fc, Semester s) {
      username = user;
      password = pass;
      GPA = gpa;
      MGPA = mgpa;
      semester = s;
      finishedcourses = fc;
  }
  
  @Override
  public int describeContents() {
      // TODO Auto-generated method stub
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel out, int flags) {
      out.writeString(username);
      out.writeString(password);
      out.writeDouble(GPA);
      out.writeDouble(MGPA);
      out.writeParcelable((Parcelable) finishedcourses , flags);
      out.writeParcelable((Parcelable) semester, flags);
  
  }
  
  
  public static final Creator&lt;Student&gt; CREATOR = new Parcelable.Creator&lt;Student&gt; (){
      public Student createFromParcel(Parcel in) {
          return new Student(in); 
      }
  
      public Student[] newArray(int size) {
          return new Student[size];
      }
  };
  
  
  public Student(Parcel in)
  {
      username = in.readString();
      password = in.readString();
      GPA = in.readDouble();
      MGPA = in.readDouble();
      finishedcourses = in.readParcelable(Course.class.getClassLoader());
      semester = in.readParcelable(Semester.class.getClassLoader());
  }}
  </code></pre>
  
  <p>this is class Semester:</p>
  
  <pre><code>public class Semester implements Parcelable{
  private LinkedList&lt;Course&gt; current;
  private int Credits;
  
  public Semester(LinkedList&lt;Course&gt; current) {
      super();
      this.current = current;
      Credits = calcCredits();
  }
  
  @Override
  public int describeContents() {
      // TODO Auto-generated method stub
      return 0;
  }
  @Override
  public void writeToParcel(Parcel out, int flags) {
      out.writeInt(Credits);
      out.writeParcelable((Parcelable) current, flags);
  
  }
  
  
  public Semester(Parcel in) {
      Credits = in.readInt();
      current = in.readParcelable(Course.class.getClassLoader());
  }
  
  
  public static final Creator&lt;Semester&gt; CREATOR = new Parcelable.Creator&lt;Semester&gt;() {
      public Semester createFromParcel(Parcel in)
      {
          return new Semester(in);
      }
  
      @Override
      public Semester[] newArray(int size) {
          // TODO Auto-generated method stub
          return new Semester[size];
      }
  };}
  </code></pre>
  
  <p>This is class course</p>
  
  <pre><code>public class Course implements Parcelable{  
  private int credits;
  private String LetterGrade,Name;
  
  public Course(int credits, String Name, String Letter) {
  this.Name = Name;
  LetterGrade = Letter;
  this.credits = credits;
  }
  
  
  @Override
  public int describeContents() {
      // TODO Auto-generated method stub
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel out, int flags) {
      out.writeString(Name);
      out.writeString(LetterGrade);
      out.writeInt(credits);
  }
  public static final Creator&lt;Course&gt; CREATOR = new Parcelable.Creator&lt;Course&gt;() {
  
      @Override
      public Course createFromParcel(Parcel in) {
          return new Course(in);
      }
  
      @Override
      public Course[] newArray(int size) {
  
          return new Course[size];
      }
  
  };
  public Course (Parcel in){
      Name = in.readString();
      LetterGrade = in.readString();
      credits = in.readInt();
  }}
  </code></pre>