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
Ivan Koch
22,817 PointsCant show the action_share icon in my Android project
Hi guys!
First time here! My name is ivan and I just started studying some android development.
Im following the blog reader project and when I try to install the action_share icon, what I get is the 3 dots verticall icon and a list display with the label share... but the icon itself is not showing!
any fix for this?
thanks !
4 Answers
Lawrence Fergus
1,653 PointsWhen new items are put on to the action bar, by defualt they are put in the settings tab. In the menu xml file add the following line to the item you wish to have permanently on the action bar:
android:showAsAction="always"
This will show the icon always.
Ivan Koch
22,817 PointsHi! thanks for your help! I still cant see it.
I have this
<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>
I also checked the treehouse project files, and they are the same. The only difference is that they have menu and a menu-v11 and the same file inside... should I do that?
Thanks again!
Ivan
Lawrence Fergus
1,653 PointsWhat version of android are you running the app on?
Ivan Koch
22,817 PointsI already published the app, so Im opening it in my samsung s3 and is not showing.
What I get is, if I press the menu button, it opens a little tab with the share tag! but the button is not showing at all. The emulator is 4.4.2 .
Any other fixes?
thanks again for your help!