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 trialAdilet Zhusupbekov
1,948 PointsMy setChoice1 and setChoice2 are not recognized.
My setChoice1 and setChoice2 are not recognized. Aondroid Studion says: Cannot resolve method.
package com.adiko.interactivestory.Model;
import com.adiko.interactivestory.R;
public class Story { private Page[] mPages;
public Story(){
mPages = new Page[7];
mPages[0] = new Page();
mPages[0].setImageId(R.drawable.page0);
mPages[0].setText("test");
mPages[0].setChoice1(new Choice());
mPages[0].setChoice2(new Choice());
}
}
2 Answers
Jon Kussmann
Courses Plus Student 7,254 PointsAre the setChoice1() and setChoice2() methods defined in your Page class (not the Choice class)?
Adilet Zhusupbekov
1,948 PointsHi Jon,
You are right. I just put them in Choice class not into the Page class. Did not pay attention. Thank you very much for help and your time!
Adilet Zhusupbekov
1,948 PointsAdilet Zhusupbekov
1,948 PointsMy Choice class: package com.adiko.interactivestory.Model;
public class Choice { private String mText; private int mNextPage; private Choice mChoice1; private Choice mChoice2;
}