Work-around for issue #415 (ShareActionProvider does not work if only on...

Hello,

I cherry-picked the specific commit as a topic branch off of dev, here is the resubmit. Thanks!

I've used this work-around code for several months in production now, with no issues once the fix for #557 is also applied (I added a couple of extra protections for that issue).