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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Michael Arsenault](https://uploads.teamtreehouse.com/production/profile-photos/374892/micro_Myr6g.gif)
Michael Arsenault
15,352 PointsShare button does not include image, and is hidden as a sub-menu option.
The Eclipse/SDK files I am using are from the CrystalBall app tutorial (downloaded 19 April 2014). The versions are as follows:
Eclipse 4.3 for Mac OS X ADT - Build v22.6.2-1085508
Following the BlogReader tutorial, I've come to an issue with the share button we've just added. Mine does not display in the menu bar, as is the case in the tutorial, but is instead embedded within a sub-menu off of the menu bar (as shown in the image below)
When following the tutorial, the button was added to the menu bar via the xml file located in menu/activity_blog_web_view.xml
. For starters, I did not have said file (mine was menu/blog_web_view.xml
). Secondly, when clicking on "Add" to add a new menu element, I was not presented with any options in the dialog box, as shown below
I modified the file name (as well as any reference to it) and manually copied the button information in the .xml file. But what I get is the text-only share button embedded within a drop-down menu.
activity_blog_web_view.xml as follows:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_share"
android:icon="@drawable/ic_action_share"
android:showAsAction="always"
android:title="@string/action_share">
</item>
</menu>
Clicking on the "Share" button has the desired effect, just not the desired look.
Any thoughts? Please let me know if I can add any further details.
Thanks in advance.
5 Answers
![Joshua Bearss](https://secure.gravatar.com/avatar/bd84de96fe405087dfdef75f86d58978?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Joshua Bearss
6,222 PointsI had to add a line in the xml file like:
xmlns:yourapp="http://schemas.android.com/apk/res-auto"
Then in the <item> declaration say:
<item
android:id="@+id/action_share"
android:icon="@drawable/ic_action_share"
android:title="@string/action_share"
yourapp:showAsAction="always" />
to get it to show up properly.
Found this at http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems
![Theodore Kruczek](https://secure.gravatar.com/avatar/d98a21b2b652c0753a6e0d2b08d1141d?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Theodore Kruczek
8,800 PointsMake sure you have the most up-to-date versions of Android APK and Eclipse. That issue with "Create a new element at the top level, in temp." was resolved for me with a recent update (and only started about two weeks ago with another update).
Your code looks right to me. Try updating and let us know if that solves it or if there is another problem.
![Michael Arsenault](https://uploads.teamtreehouse.com/production/profile-photos/374892/micro_Myr6g.gif)
Michael Arsenault
15,352 PointsJust updated Eclipse and SDK from the Google Android developer site, but the issue persists. My experience with Android so far has been pretty bad. Lots of bugs, slow emulator, etc. Big headache.
![Michael Arsenault](https://uploads.teamtreehouse.com/production/profile-photos/374892/micro_Myr6g.gif)
Michael Arsenault
15,352 PointsIt's the onCreateOptionsMenu
method that was automatically created in the BlogWebViewActivity
class. Just remove it.
![Masum Bergmann](https://uploads.teamtreehouse.com/production/profile-photos/803862/micro_MBs.jpg)
Masum Bergmann
Courses Plus Student 4,129 Pointsjust fyi, this solution did not work for me... when I removed onCreateOptionsMenu()
the options icon simply disapeared, and the share icon was still nowhere to be found.
![Kevin Lavi](https://uploads.teamtreehouse.com/production/profile-photos/590442/micro_302405_10150348698680958_500129961_n.jpg)
Kevin Lavi
3,311 PointsWere you able to figure this out? I'm having the same issue currently and I followed each step as is.
Masum Bergmann
Courses Plus Student 4,129 PointsMasum Bergmann
Courses Plus Student 4,129 PointsFantastic! That did the trick... Thanks for that!