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 Build a Self-Destructing Message Android App Starting the App Adding the Login Screen

Zerui Ma
Zerui Ma
5,422 Points

Default Layout settings have been changed...

When I start a blank new login activity, by default, eclipse force me to use a container framelayout accompanying with a fragment layout file to display.

So what's the advantage of using framelayout+fragments instead of using relativeLayout straightly?

And for this project if I wanna to switch back to using relativeLayout, do I have to delete the fragment and the framelayout, and then set up a new relativeLayout and paddings? Can I change this default layout settings by any chance?

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

The advantage is kind of nonexistent for this project. The Android best practice is to use Fragments because they promote modular code and reusability. But it's overkill for simple Activities like what we have.

I've posted instructions some of the other projects about how to remove the fragments, and you should be able to use the same instructions. Here's a Forum post with the instructions on how to remove the Fragment: https://teamtreehouse.com/forum/the-getsupportfragmentmanager-is-not-a-public-method-of-listactivity