I created a share button on the action bar and although I like the fact it allows me to share to communication components like messaging. I wanted to remove the recently shared button that appears after you've shared to for instance messaging.
Irina Goble wrote:Have you tried to set the shared history file to null? Something like:
I tried that, couldn't get it to work...
What did you try? What didn't work? What Irina described is what you should be doing. Read the API for ShareActionProvider for a description (see here).
posted 4 years ago
I've never used ShareActionProvider before. The documentation says:
Set to null if share history should not be persisted between sessions.
I tried a simple app to see how it works and turns out there is more to it.
This class, ShareActionProvider, gets quite involved with keeping history of called activities. And there is no simple way to disable the default activity button as it is set not just from a history file but from the history records in the underlying Adapter. Here is a code fragment from the source code that is responsible for this: android.widget.ActivityChooserView.updateAppearance()