Java Code Examples for cn.sharesdk.framework.ShareSDK#setActivity()
The following examples show how to use
cn.sharesdk.framework.ShareSDK#setActivity() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformAuthorizeUserInfoManager.java From ShareSDK-for-Android with MIT License | 5 votes |
/** * 授权的代码 */ public void doAuthorize(Platform platform, Activity activity) { if (platform != null) { platform.setPlatformActionListener(myPlatformActionListener); if (platform.isAuthValid()) { platform.removeAccount(true); return; } ShareSDK.setActivity(activity); //platform.SSOSetting(true); platform.authorize(); } }
Example 2
Source File: PlatformAuthorizeUserInfoManager.java From ShareSDK-for-Android with MIT License | 5 votes |
/** * 用户信息的代码 */ public void doUserInfo(Platform platform, Activity activity) { if (platform != null) { ShareSDK.setActivity(activity); platform.showUser(null); } }
Example 3
Source File: QQZoneShare.java From ShareSDK-for-Android with MIT License | 5 votes |
public void shareQQMiniProgram(Activity activity) { Platform platform = ShareSDK.getPlatform(QZone.NAME); Platform.ShareParams shareParams = new Platform.ShareParams(); shareParams.setText("QQ小程序"); shareParams.setTitle("QQ互联"); shareParams.setTitleUrl("http://www.qq.com/"); shareParams.setImageUrl("http://www.3wyu.com/wp-content/uploads/6e0eaf15gy1fvr5tnm2dfj20f108gtad.jpg"); shareParams.setShareType(Platform.QQ_MINI_PROGRAM); shareParams.setQQMiniProgramAppid("1108318575"); shareParams.setQQMiniProgramPath("page/share/index.html?share_name=QQ%E9%9F%B3%E4%B9%90&share_key=5aIqFGg&from=disk"); shareParams.setQQMiniProgramType(""); ShareSDK.setActivity(activity); platform.setPlatformActionListener(platformActionListener); platform.share(shareParams); }