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


implementing designs

Now switch to the ArtistActivity.java file. This also has tabs, but we are going to use icons instead of text. Set the icon for each tab using the setIcon() method, and use the value returned by the PagerAdapter's getIcon() method as the parameter for setIcon().

i got it now: tab.setIcon(pagerAdapter.getIcon(i));

thanx, that helped

1 Answer

Ivan Sued
Ivan Sued
5,969 Points

Hey Adlight Sibanda ,

This one is very similar to the previous problem. The difference is that you are calling the setIcon() method on the tab and as a parameter you want the returned value of getIcon() method of the pagerAdapter class.

It would look something like this: tab.setIcon(pagerAdapter.getIcon(i));

Here is some more reference on the setIcon method.

crystal clear Ivan !!