I tried to use android.support.v7.widget.ShareActionProvider on actionbar in my app. So I followed the example from android document but got some issues.
Here\'s my m
There is another potential related problem. If your MenuItem is always present in the ActionBar, using the following code:
menuItem?.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
the resulting Menu item won't work (it will be visible, but not enabled). There are two options, either change the ShowAsAction type or call setShareIntent directly in the onCreateOptionsMenu() function:
this@MyAwesomeActivity.runOnUiThread(java.lang.Runnable {
actionProvider.setShareIntent(shareIntent)
})