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 Relating Users in Parse.com Selecting Friends from a List

kai qin
kai qin
7,735 Points

Questions about using ListView Adapter in Fragment

The EditFriends Activity is built with fragment by default in eclipse. I use the setListAdapter method in findBackground(). But when I clicked on the Menu- Edit Friends. The app crashes.

3 Answers

Masum Bergmann
PLUS
Masum Bergmann
Courses Plus Student 4,129 Points

My eclipse also keeps creating Fragments for each new Activity created (slightly annoying). My solution is to copy the the xml from the layout_fragment and use it to replace the layout_activity. Then delete the layout_fragment, and delete the code in the Activity class that still refers to the fragment... and you're all set... you now have a new and clean activity (without the fragment).

Hope this helps!

kai qin
kai qin
7,735 Points

Thank you Masum. I just tried it. It works.