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 Blog Reader Android App Rebuilding from Scratch Creating the Project and ListActivity

Omar Tsai
Omar Tsai
1,704 Points

I don't get the fragment layout generated on android studio?

Why is the fragment layout not generated on android studio? I only have 1 layout and that is the activity_main_list.xml

I also tried this on Eclipse and not getting anything show up where I can add the fragments.

But I see that it gets deleted elsewhere in the video anyways.

2 Answers

Because android studio is not eclipse. There are some major differences. If you try to create a new project instead of blank activity like the instructor does, there is one option that says with fragments. You won't need the fragment that gets created because the instructor deletes it later on, but in case you need it in the future, do not choose blank activity, there is another option that contains fragments.

Dear Gloria,

But I have tried both in Eclipse and Android Studio. The fragment layout never appeared. What's wrong with mine? I'll be thanks for your answer :)

Hey there Mukhamad Mukhsin Wibowo :) If you really want fragments (even though in the initial two projects you don't need it), instead of blank activity, in android studio try to see if you have an option called... "Blank Activity with Fragment".

OK. Thanks gloria :)

You are welcome :D