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

Fragment_Main_List.xml

In the project for "Build a blog Reader for Android App", after we create project folder we have two files in the layout folder activity_main_list.xml and Fragment_Main_List.xml. Can someone clarify why we must delete the fragment file? Whats it's purpose? thanks in advance.

2 Answers

Short Answer: The code for a fragment is different than for an activity. The videos were made for an older version of Android SDK that did not push developers to use fragments by default.

Longer Answer: You don't HAVE to delete them, but the videos were made before Android SDK started adding them by default. I would recommend deleting them, learning how to make the app without fragments and then when you are comfortable, recreate the app using the fragments for a tablet. I just finished the self-destructing messenger app using fragments on my first time through and it created a lot of problems that I had to look up on my own to overcome.

Okay thanks alot, i understand now! I'll just keep working at it thanks again.