Work-around for issue #415 (ShareActionProvider does not work if only one intent)

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).