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

Android Build a Self-Destructing Message Android App Using Fragments for Tabs Modifying Tabs from the Template

Marc-Oliver Gern
Marc-Oliver Gern
8,747 Points

In 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

I am having the same problem unfortunately.

Yes, now it works! Hooray! :)

I copied and pasted this to no avail? Is it a problem with TeamTreehouse.com?