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

Android Build a Blog Reader Android App Using Intents to Display and Share Posts Easy Sharing with Intents

Jorge Barrios
Jorge Barrios
8,278 Points

Missing Share icon

I don't know if i miss something on the video but my app don't show the share icon it shows me the tree little dots and when i click there I can see the option to share and it works perfectly but the icon does not appear

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Jorge,

You need to add an attribute to the XML for the menu. It's in the video somewhere, but what you're looking for is:

android:showAsAction="always"

Jorge Barrios
Jorge Barrios
8,278 Points

Hi Ben,

I watched the video again but i'm still seeing in the action bar a button with 3 dots and when I tap there it open a menu list with my share item(Only text-title) inside and it works i can share the posts, my XML looks like 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>

alt text

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Strange! Perhaps an older version is cached on the device and your changes aren't being pushed. Try deleting the app from your device or emulator. Then clean your project and run it again and see if that forces the update you expect.

Jorge Barrios
Jorge Barrios
8,278 Points

Thanks Ben, I found the error for some reason my BlogWebViewActivity was extending ActionBarActivity i change it to Activity and solved the problem.