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

This Is The Droid You Are Looking For con't: You can't get the Action Bar to show in EditFriendsActivity

So, once again, we've hit a problem with deprecated code and differences between Eclipse and Android Studio. The EditFriendsActivity overlays the ActionBar, and now you can't see it. If you want to fix this, what we have to do is split this activity into a Activity and a fragment inside an activity, like we did with MainActivity, displaying InboxFragment and FriendsFragment inside of it. This answer is a continuation of the "This Is The Droid You Are Looking For" from the Modifying Tabs From The Template video from the previous badge. It uses all non-deprecated code and looks a little different, so I strongly suggest you look over my answer there before attempting this:

https://teamtreehouse.com/forum/this-is-the-droid-you-are-looking-for-how-to-get-past-this-lesson-while-knowing-the-modern-standard

Because the problems are getting a little big, I'm going to give you the link to the GitHub page that has the current version of this code relating to this specific class progress in the answer, so go there for the source.

2 Answers

fm.beginTransaction().add(android.R.id.content, list).commit();

what the heck is this line in EditFriendsActivity?

Leifu Chen
Leifu Chen
10,603 Points

Check your import in EditFriendsFragment.java, using android.app.ListFragment.

Let me know if you have questions, the code on the right is the code you're looking for. I made this link point to the direct commit of this code for where we are at.

https://github.com/nicolasjhampton/Ribbit/commit/186ddde37036edc55e03bd89c883e4906fcdbe6c?diff=split

I'll try and consolidate an explanation later on how to get from the first answer to the second.

Spooky - I had literally just run into this problem when you posted this. I had already switched to using a ListFragment (added statically in the layout) in the last video but was running into problems with this video. This code works perfectly - many thanks!

No problem @johnsmith74! Happy coding!

fm.beginTransaction().add(android.R.id.content, list).commit();

what the heck is this line in EditFriendsActivity? I am getting an error here.