udenfox
udenfox

Reputation: 1604

Share button in ActionBar icon not default. How to change it?

I added share button to my ActionBar, but icon of that button seems not ok.

Default button looks like that: https://monosnap.com/image/yiBpHo6XcMWKmXD1zwcy2w2gRkFBPN.png

But in my case it looks just like "SHARE" textin actionBar: https://monosnap.com/image/d8cXbr5XIFtwItoaXAKkTjVBPr5eEa.png

How to change it to default?

Here is my menu xml file for activity:

<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.XXXXXXX.XXXXXXXXXXX.app.SomeActivity" >
<item
        android:id="@+id/menu_item_share"
        app:showAsAction="always"
        android:title="Share"
        android:actionProviderClass= "android.widget.ShareActionProvider" />
</menu>

Upvotes: 1

Views: 904

Answers (2)

Naveen Tamrakar
Naveen Tamrakar

Reputation: 3339

 <item
    android:id="@+id/menu_item_share"
   android:orderInCategory="100"
    android:title="Share"
    android:icon="@drawable/ic_launcher"
    app:showAsAction="always"/>

Upvotes: 0

Kristijan Drača
Kristijan Drača

Reputation: 614

add this

android:icon="@android:drawable/ic_menu_share"

Upvotes: 3

Related Questions