Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Self-Destructing Message Android App Sending Messages Adding a Send Button

I have no idea what to do or what is wrong

I have spent the last several hours trying to figure out how to make the icon show up. Ive gone through all the old questions which complain about how depreciated the video is and the solutions they have seem depreciated I think. Ive reworked all the code from the RecipientsActivity over a dozen times and I feel like Ive broken my code and tinkered with other files too much and I just have no idea what to do since I don't understand at all why none of the things I have tried dont work.

Ok so I think I got it back to where it was, It will still not load the icon in the action bar but it does load the action bar without giving an error. Everything I do from here gives an error and crashes the app. I dont know what to do next though.

-Edit and by Back to where it was I mean very Similar to what the code is in the video. I remember I had to do a lot of tinkering to get the action bar to appear but I dont remember what I did in the other files but the files in question (RecipientsActivity, activity_recipients.xml) seem identical to the video now

1 Answer

finally figured it out. In the recipients.xml file the line android:showAsAction="always" gave off a red swiggle line so I switched it to app:showAsAction="always" as it was recommended. This switched the app from showing the icon when i hit the settings button (hardware button) to being in the top right corner as it should be.