The reason for the "share-click" button without a clickable is not enough intention for your actionProvider (this is the intention by which Android can find a match).
Try installing it through
mShareActionProvider.setShareIntent(youIntentWithAction);
before you return from onCreateOptionsMenu
Update
I believe that it works correctly for the case showAsAction = "never" just because the intention is set correctly by the time you open the overflow options (those marked with "never") and click " shareItem " and this does not happen when you use it action bar.
It is assumed that you configured your action in the onPrepareOptionsMenu implementation (if any), which will be called only when overflow elements are opened (+ once during startup), and not for actionBar elements.
important thing :
onOptionsItemSelected NOT triggered for a menu item using actionProvider if it is shown in the action bar (i.e. actionProvider will still run onOptionsItemSelected when the user acts if this actionProvider is in the overflow menu).
This may explain why you cannot dynamically setShareIntent for your showAsAction="ifRoom" when showAsAction="ifRoom" .
If you still want setShareIntent in onOptionsItemSelected , you may need to do this when handling the selection of another element (non-actionProvier).
Let me know if this helps.
kiruwka
source share