ActionBarSherlock - 共享内容的图标问题 [英] ActionBarSherlock - Share Content icon issue

查看:128
本文介绍了ActionBarSherlock - 共享内容的图标问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ActionBarSherlock 和已实施 ShareActionProvider

当用户选择一个应用程序来使用,例如:微博共享内容,在动作条显示微博图标共享按钮图标。这种保持永远存在。

When a user selects an app to share content with, eg Twitter, the actionbar displays a Twitter icon next to the Share button icon. This stays there forever.

有谁知道如何出现旁边的共享按钮关闭应用程序图标?

Does anybody know how to disable the application icon from appearing next to the Share button?

推荐答案

找到了答案:

实施OnShareTargetSelectedListener并在其设置 ShareActionProvider

Implement OnShareTargetSelectedListener and set it on the ShareActionProvider

public void onCreateOptionsMenu(Menu menu){
    ....
    actionProvider.setOnShareTargetSelectedListener(this);
    ....


 @Override 
 public boolean onShareTargetSelected(ShareActionProvider source, 
         Intent intent) { 

     context.startActivity(intent); 

     // started activity ourself to prevent search history 
     return true; 
 } 

这篇关于ActionBarSherlock - 共享内容的图标问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆