Java 类android.widget.ShareActionProvider.OnShareTargetSelectedListener 实例源码

项目:Ships    文件:ShowMapFragment.java   
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.setGroupVisible(R.id.main_menu_group_share, true);

    final ShareActionProvider shareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();
    shareActionProvider.setShareIntent(getShareIntent());
    shareActionProvider.setOnShareTargetSelectedListener(new OnShareTargetSelectedListener() {
        @Override
        public boolean onShareTargetSelected(ShareActionProvider actionProvider, Intent intent) {
           Analytics.getInstance().logEvent(TAG, "share","");
           takeScreenShotWithCheck();
           return false;
        }
    });
}