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 trialNicolas Hampton
44,638 PointsThis 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:
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
Sam smith
Courses Plus Student 59 Pointsfm.beginTransaction().add(android.R.id.content, list).commit();
what the heck is this line in EditFriendsActivity?
Nicolas Hampton
44,638 PointsLet 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
Nicolas Hampton
44,638 PointsNicolas Hampton
44,638 PointsI'll try and consolidate an explanation later on how to get from the first answer to the second.
johnsmith74
1,858 PointsSpooky - 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!
Nicolas Hampton
44,638 PointsNo problem @johnsmith74! Happy coding!
Sam smith
Courses Plus Student 59 Pointsfm.beginTransaction().add(android.R.id.content, list).commit();
what the heck is this line in EditFriendsActivity? I am getting an error here.
Leifu Chen
10,603 PointsLeifu Chen
10,603 PointsCheck your import in EditFriendsFragment.java, using android.app.ListFragment.