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 Android Lists and Adapters (2015) Standard ListViews Introducing ListView and ListActivity

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

How to get a RelativeLayout by default

I noticed that when Ben generates his new activity and view in the video, it comes up as a RelativeLayout View.

I'm using AS 2.3.2. There's no option for a "blank" activity so I'm using either an "Empty" Activity or a "Basic" activty. Either of these gives me a Constraint layout rather than a Relative.

I've a tried adding a new Relative Layout from the palette but there's no way to make this the root layout and it will only go as a child of a Constraint.

How can I create a new activity with a default RelativeLayout? Thanks :)

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Jonathan! I think you'd have to create your own custom template for that. However, to change the ConstraintLayout to RelativeLayout you can just use the Text tab instead of the XML tab.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Thanks :)

I was able to change it as you suggested via the text view. I suppose the difference is nothing more than a change in the standard since the video was made. I love the GUI but the XML knowledge is useful too