2

I am trying to develop an ActionBar which contains a share button, but if the user clicks on the share nothing happens.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/menu_item_share"
        app:showAsAction="ifRoom"
        android:title="Share"
        android:actionProviderClass=
            "android.widget.ShareActionProvider" />
    ...
</menu>

1 Answer 1

1

You should use the app compat's action provider as:

<item
    android:id="@+id/menu_item_share"
    app:showAsAction="ifRoom"
    android:title="Share"
    app:actionProviderClass="android.support.v7.widget.ShareActionProvider" />
1
  • 1
    I'm having same problem that the share item is not clickable, although I'm using android.support.v7.widget.ShareActionProvider any ideas ?
    – Poula Adel
    Commented Jun 27, 2017 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.