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 trialMarc-Oliver Gern
8,747 PointsIn the adapter code below, set the number of tabs to 4. Code Challenge "Using Fragments for Tabs".
Seems completely broken. Did someone pass that test?
I typed in:
// Some code omitted!
@Override
public int getCount() {
return 4;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "Coffee";
case 1:
return "Rooibos";
case 2:
return "Green";
case 3:
return "Herbal";
}
return null;
}
}
4 Answers
Mathias Andersen
13,832 PointsI am having the same problem unfortunately.
Marc-Oliver Gern
8,747 PointsNo it works. Try it Mathias.
Mathias Andersen
13,832 PointsYes, now it works! Hooray! :)
Idenson Eltume
15,444 PointsI copied and pasted this to no avail? Is it a problem with TeamTreehouse.com?