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 Styles and Themes in Android Using Styles in Layouts Using Includes for Repeatable Layouts

In question "What must the root element be for a layout component that will be included in other layout files?"

I choose It must be a ViewGroup ... But system say "You are wrong"

3 Answers

Scott Junner
Scott Junner
9,010 Points

I recall getting this wrong and getting grumpy about it. The accepted answer for the quiz is <merge>. But knowing the answer is not nearly as good as understanding the answer.

Understanding can be found in this Android Developer Documentation Resource

Carlo Antonio Bilbao
Carlo Antonio Bilbao
24,113 Points

yeah, this was annoying. Mostly because it wasn't in the example code. Merge is the correct answer in some cases, but a ViewGroup can also be the correct answer depending on the situation. Thanks for the link! It definitely cleared things up for me.