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!

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


Action Bar tabs - how to fill the fragments with elements?


I've builded a new tabbed activity in android studio and chosen the nav style "action bar tabs (with viewPager)".

Now I have 2 xml files, one for the activity and one for the fragment. When I add an element in the fragment xml file, it is visible doesn't matter which tab is currently opened.

How can i define the elements for the different tabs?

Thank you guys!