当前位置: 首页>>代码示例>>Java>>正文


Java ShareSDK.initSDK方法代码示例

本文整理汇总了Java中cn.sharesdk.framework.ShareSDK.initSDK方法的典型用法代码示例。如果您正苦于以下问题:Java ShareSDK.initSDK方法的具体用法?Java ShareSDK.initSDK怎么用?Java ShareSDK.initSDK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.sharesdk.framework.ShareSDK的用法示例。


在下文中一共展示了ShareSDK.initSDK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showShare

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private void showShare() {
        ShareSDK.initSDK(this);
        OnekeyShare oks = new OnekeyShare();
        //隐藏
        oks.addHiddenPlatform(QQ.NAME);
        oks.addHiddenPlatform(SinaWeibo.NAME);
        oks.addHiddenPlatform(TencentWeibo.NAME);
        oks.addHiddenPlatform(QZone.NAME);
        oks.addHiddenPlatform(WechatFavorite.NAME);
        oks.addHiddenPlatform(Facebook.NAME);
        oks.addHiddenPlatform(Twitter.NAME);
        oks.addHiddenPlatform(ShortMessage.NAME);

        oks.disableSSOWhenAuthorize();
        String packgeName = mTextView_Title.getText().toString();
        if (!packgeName.isEmpty() && packgeName != "") {
            oks.setTitle(packgeName);
            mTitle = packgeName;
        } else {
            oks.setTitle(mTitle);
        }
        oks.setShareContentCustomizeCallback(new ShareContentCustomizeCallback() {
            @Override
            public void onShare(Platform platform, Platform.ShareParams paramsToShare) {
                if (WechatMoments.NAME.equals(platform.getName())) {
                    paramsToShare.setTitle(summary);
                }
            }
        });
        oks.setText(summary);
//        oks.setImagePath(mImageTemp+"/yyox.png");  //分享sdcard目录下的图片
        oks.setImageUrl(CommonUtils.getBaseUrl()+"/app/share/images/share.jpg");
        oks.setUrl(url + "?orderNo=" + searchNo + "&orderStatus=" + orderStatus + "&companyCode=" + companyCode + "&title=" + mTitle+"&customerId="+mCustomerId);
        oks.show(this);
    }
 
开发者ID:Zyj163,项目名称:yyox,代码行数:36,代码来源:OrderTrackingActivity.java

示例2: b

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private static void b(Context context, BMPlatform bMPlatform, b bVar) {
    String e = bVar.e();
    if (m.a().o()) {
        c.d("aaron share sdk");
        ShareSDK.initSDK(context);
        if (bMPlatform == BMPlatform.PLATFORM_WXSESSION) {
            com.zxinsight.share.c.a.a(context, bVar);
        } else if (bMPlatform == BMPlatform.PLATFORM_WXTIMELINE) {
            com.zxinsight.share.c.a.b(context, bVar);
        }
    } else if (bMPlatform == BMPlatform.PLATFORM_WXSESSION || bMPlatform == BMPlatform
            .PLATFORM_WXTIMELINE) {
        ActivityFactory activityFactory = new ActivityFactory(context, MWActivity
                .ACTIVITY_TYPE_WX);
        Intent intent = activityFactory.getIntent();
        MWWXHandlerActivity.setListener(b(bMPlatform));
        intent.putExtra("platform", bMPlatform);
        intent.putExtra("fromShare", true);
        intent.putExtra("realUrl", e);
        MWWXEntryActivity.shareData = bVar;
        activityFactory.startActivity();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:a.java

示例3: show

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = com.mob.tools.utils.R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:31,代码来源:OnekeyShare.java

示例4: init

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private void init() {
    mHandler = new Handler(this);
    ShareSDK.initSDK(getContext());
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    if (platform.isAuthValid()) {
        showUser(platform);
    }
}
 
开发者ID:Leavessilent,项目名称:QuanMinTV,代码行数:9,代码来源:MineFragment.java

示例5: showShare

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private void showShare() {
    ShareSDK.initSDK(this);
    OnekeyShare oks = new OnekeyShare();
    oks.disableSSOWhenAuthorize();

    oks.setTitle("tl");
    oks.setTitleUrl("http://fir.im/6md5");
    oks.setText("田亮");
    oks.setImagePath("file:///android_asset/home_iamge2.png");
    oks.setUrl("http://fir.im/6md5");
    oks.setComment("我是测试评论文本");
    oks.setSite(getString(R.string.app_name));
    oks.setSiteUrl("http://fir.im/6md5");
    oks.show(this);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:16,代码来源:UserInviteActivity.java

示例6: show

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	MobSDK.init(context.getApplicationContext());
	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:32,代码来源:OnekeyShare.java

示例7: onCreate

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_trip_detail);
    ButterKnife.bind(this);
    getData();
    initToolbar();
    initWebView();
    ShareSDK.initSDK(this);
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:11,代码来源:TripDetailActivity.java

示例8: show

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context.getApplicationContext());

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
开发者ID:Leavessilent,项目名称:QuanMinTV,代码行数:31,代码来源:OnekeyShare.java

示例9: show

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context);
}
 
开发者ID:Jusenr,项目名称:androidgithub,代码行数:31,代码来源:OnekeyShare.java

示例10: onCreate

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_invite_friend);
    ButterKnife.bind(this);
    ShareSDK.initSDK(this);
    initEvent();
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:9,代码来源:InviteFriendActivity.java

示例11: onCreate

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    LitePal.initialize(this);
    //初始化融云
    initRongCloud();
    //初始化红包
    initRedPacket();
    //初始化仿微信控件ImagePicker
    initImagePicker();
    //初始化表情控件
    LQREmotionKit.init(this, (context, path, imageView) -> Glide.with(context).load(path).centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView));
    //初始化ShareSDK
    ShareSDK.initSDK(getContext());
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:16,代码来源:MyApp.java

示例12: showShare

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private void showShare(String shareText) {
ShareSDK.initSDK(this);
      OnekeyShare oks = new OnekeyShare();
      //关闭sso授权
      oks.disableSSOWhenAuthorize();
      // 分享时Notification的图标和文字
      oks.setNotification(R.drawable.ic_launcher, getString(R.string.app_name));
      // title标题,印象笔记、邮箱、信息、微信、人人网和QQ空间使用
      oks.setTitle("火车行");
      // titleUrl是标题的网络链接,仅在人人网和QQ空间使用
      oks.setTitleUrl(WEB_SITE);
      // text是分享文本,所有平台都需要这个字段
      oks.setText(shareText);
      // imagePath是图片的本地路径,Linked-In以外的平台都支持此参数
      oks.setImagePath(imageDataPath);
      // url仅在微信(包括好友和朋友圈)中使用
      oks.setUrl(WEB_SITE);
      // comment是我对这条分享的评论,仅在人人网和QQ空间使用
      oks.setComment(shareText);
      // site是分享此内容的网站名称,仅在QQ空间使用
      oks.setSite(getString(R.string.app_name));
      // siteUrl是分享此内容的网站地址,仅在QQ空间使用
      oks.setSiteUrl(WEB_SITE);

      // 启动分享GUI
      oks.show(this);
 }
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:28,代码来源:ShareContentAty.java

示例13: onCreate

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_message_detail);
    ButterKnife.bind(this);
    getData();
    initToolbar();
    initWebView();
    ShareSDK.initSDK(this);
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:11,代码来源:MessageDetailActivity.java

示例14: onCreate

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
@Override
    public void onCreate() {
        super.onCreate();

        app = this;

        // 存放所有activity的集合
        mActivityList = new ArrayList<>();

        // 初始化app异常处理器 - 打包的时候开启
//        CrashHandler handler = CrashHandler.getInstance();
//        handler.init(getApplicationContext());

        // 初始化OkHttpUtils
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();
        OkHttpUtils.initClient(okHttpClient);

        // 初始化Fresco
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
                .build();
        Fresco.initialize(this, config);

        // 初始化ShareSDK
        ShareSDK.initSDK(this);

        // 初始化JPush
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);

        // 更新用户登录状态
        UserBean.updateUserInfoFromNetwork(new UserBean.OnUpdatedUserInfoListener());

    }
 
开发者ID:6ag,项目名称:LiuAGeAndroid,代码行数:39,代码来源:App.java

示例15: ensureInit

import cn.sharesdk.framework.ShareSDK; //导入方法依赖的package包/类
private static void ensureInit(Context context) {
	checkIsParamValid(context);
	ShareSDK.initSDK(context.getApplicationContext());
}
 
开发者ID:isuhao,项目名称:QMark,代码行数:5,代码来源:ShareSdk.java


注:本文中的cn.sharesdk.framework.ShareSDK.initSDK方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。