Reputation: 479
I'm quite new to Android development and I'm trying to build an ActionBar with the ShareActionProvider, using the "stock" ActionBar (i.e. not using ActionBarSherlock), because I want to target ICS+ devices only.
I would like the history function enabled (as it is by default), but I don't want the most used intent icon near the share button, because it takes too much space.
I know that using ActionBarSherlock this is possible, but as I said I'm trying to do it with the stock ActionBar, so I would like to know how to overcome to this problem.
I've found these two related answers:
How to hide the share action (which use most) icon near the share action provider?
Android: ShareActionProvider with no history
but none of them clearly say how to edit the Android sources to have another "version" of the ActionBar that hides the icon.
I mean, how can I combine the two answers and ship my application with the modified ActionBar class that hides the most-used icon?
EDIT:
I'm looking for a brief list of operations that have to be done to extend the three classes ShareActionProvider, ActivityChooserView and ActivityChooserMode to build a modified version of them that doesn't raise errors in Eclipse.
AFAIK this is not documented elsewhere on the web (Google doesn't give results).
Upvotes: 2
Views: 2719
Reputation: 101
You're all set!
Upvotes: 0
Reputation: 1006614
but none of them clearly say how to edit the Android sources to have another "version" of the ActionBar that hides the icon.
That is because you do not change the action bar. You change the ShareActionProvider
. If you do not like the existing implementation of ShareActionProvider
, create your own, perhaps using the existing implementation as a starting point.
For example, that is what the accepted answer on the Android: ShareActionProvider with no history question describes. Neither the question nor the answer reference ActionBarSherlock.
Upvotes: 1