Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Rodrigo Ayala
2,791 PointsAdding Icons to Tabs - Code Challenge
So the challenge asks me to set the text for each tab using the method setText() using the value returned by the PagerAdapter's getPageTitle() method:
'''
for (int i = 0; i < pagerAdapter.getCount(); i++) { ActionBar.Tab tab = mActionBar.newTab();
tab.setText(mActionBar.getPageTitle(i));
tab.setTabListener(this);
mActionBar.addTab(tab);
}
'''
Here is my code. Am i doing something wrong setting it?
3 Answers

Shawn Anderton
24,124 Pointsoops, I have extra . in pagerAdapter.getPageTitle(i)

Shawn Anderton
24,124 Pointsneed to call the getPageTitle() from the PagerAdapter's class. so need change mActionBar.getPageTitle(i) to pagerAdapter..getPageTitle(i)

Rodrigo Ayala
2,791 PointsThanks for the help Shawn! Solved it!