如何隐藏共享的行动(其中使用最多的)图标附近的占有率行动提供商? [英] How to hide the share action (which use most) icon near the share action provider?
问题描述
看图片。我怎么能隐藏图标P,这意味着份额Pinterest的?
See the picture. How can i hide the icon "P" which means share to Pinterest?
他们都在行动起来吧,我用ActionBarSherlock。
They are both on the action bar and I use ActionBarSherlock.
推荐答案
如果你想为让所有的共享历史数据模型,但只是不希望额外的默认共享活动ICOM 。在回答<一href="http://stackoverflow.com/questions/10706564/how-do-you-turn-off-share-history-when-using-shareactionprovider">How你关闭共享的历史使用ShareActionProvider时候?是不够好。
If you wish to keep all the share history data model, but just don't want the extra "default share activity" icom. The answer at How do you turn off share history when using ShareActionProvider? is not good enough.
你应该做的是:
- 复制这些类从ActionBarSherlock到项目code
- ShareActionProvider.java
- ActivityChooserView.java
- Copy these classes from the ActionBarSherlock to your project code
- ShareActionProvider.java
- ActivityChooserView.java
- 找到行
如果(activityCount&GT; 0安培;&安培; historySize&GT; 0)
- 替换该行与
如果(假)
的(它的pretty的丑陋,但它是最快捷的修补程序。你可以深入到code去除DefaultActivity实现所有实例)的
- find the line
if (activityCount > 0 && historySize > 0)
- replace this line with
if (false)
(it's pretty ugly, but it's the quickest fix. you can delve into the code to remove all occurrences of DefaultActivity implementation)
编辑:的 不要忘记设置新的
ActionProvider
你的菜单项,从XML它看起来像:机器人:actionProviderClass =COM * CustomShareActionProvider。
Don't forget to set the new
ActionProvider
to your menu item, from XML it would look like:android:actionProviderClass="com.*.CustomShareActionProvider"
这就是它!
这篇关于如何隐藏共享的行动(其中使用最多的)图标附近的占有率行动提供商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!