Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


where is me going wrong?????

now we are ready to parcel in.In the constructor that takes a Parcel parameter,add code to set the member variable from the Parcel passed in.Remember,use the appropriate read methods based on types ,and order matters.

Parcel parcel = getParcel();

I don't 100% understand the question but normally

Parcel parcel =new Parcel(); //creates a new parcel unless Parcel is a singleton 

however this looks like it is asking you to parse a Parcel to the constructor of another class so

  public class Foo
      private Parcel mParcel;
      public foo(Parcel parcel){

now you can call

     Parcel parcel =new Parcel();
     Foo f= new Foo(parcel);

then do 


mTitle = in.readString(); mYear = in.readInt();

2 Answers

Nazar Nasirzada
Nazar Nasirzada
5,347 Points

1) In the 1st task your code should be like that:

public VideoGame(Parcel in) {
        // Task 1 code here!
      mTitle = in.readString();
      mYear = in.readInt();

2) Now it's time to work on the CREATOR variable. The first thing we need to do is return a new VideoGame in the createFromParcel() method. Make sure you use the source parameter!

        public VideoGame createFromParcel(Parcel source) {
            // Task 2 code here!
            return new VideoGame(source);

3) Finally, we need to update the length of the array returned in the Creator's 'newArray()' method. Use the size parameter passed in.

        public VideoGame[] newArray(int size) {
            // Task 3 code here!
            return new VideoGame[size];
Alex Londono
Alex Londono
2,033 Points

Thank you very much. You made it so compressed I feel so dumb now :(

Thank you Nazar it worked very well