Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBarSherlock - Share Content icon issue

I am using ActionBarSherlock and have implemented 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?

like image 940
tiptopjat Avatar asked Dec 06 '25 13:12

tiptopjat


1 Answers

Found the answer:

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; 
 } 
like image 74
tiptopjat Avatar answered Dec 08 '25 03:12

tiptopjat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!