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 trialMarco Jonker
2,109 PointsCamera Icon wont add to Action Bar
I have changed the xml file (main.xml) to change the overflow menu in the mainactivity, but for some reason the picture wont show up. I still am only getting the original items (log out and edit friends). Did anybody else come across this issue?
3 Answers
Marco Jonker
2,109 Pointsbesides the fact that I forgot the "@" before "drawable/ic_..." it still doesnt work after that is fixed.
Ben Jakuben
Treehouse TeacherPaste your main.xml menu layout and we'll have a look. :)
Marco Jonker
2,109 Points<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.marcojonker.ribbit.MainActivity" >
<item
android:id="@+id/action_edit_friends"
android:title="@string/menu_edit_friends_label">
</item>
<item
android:id="@+id/action_logout"
android:title="@string/menu_logout_label">
</item>
<item
android:id="@+id/action_camera"
android:icon="drawable/ic_action_camera"
android:showAsAction="always"
android:title="@string/menu_camera_label">
</item>
</menu>
thanks.
Ben Jakuben
Treehouse TeacherBen Jakuben
Treehouse TeacherIf you have the @ symbol in there then everything matches my own project. Can you try cleaning and reinstalling your project?
If you still have trouble, can you add a screenshot of how your app looks? Can you verify that ic_action_camera looks okay?
Marco Jonker
2,109 PointsMarco Jonker
2,109 Pointsi had to change
android:showAsAction="always"
to
app:showAsAction="always"
I'm not sure why that made the difference.
Ben Jakuben
Treehouse TeacherBen Jakuben
Treehouse TeacherAh, I think this may have to due with the fact that the support library is now being included in the projects when we start. The tools were updated this way recently. Here's a StackOverflow question that talks about this problem: http://stackoverflow.com/q/17914017/475217 I'm going to see about adding a note to address this. Sorry for your trouble!