Java Code Examples for cn.sharesdk.framework.Platform#isClientValid()

The following examples show how to use cn.sharesdk.framework.Platform#isClientValid() . 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: GooglePlusShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo() {
	Platform platform = ShareSDK.getPlatform(GooglePlus.NAME);
	if (platform != null && platform.isClientValid()) {
		Platform.ShareParams shareParams = new Platform.ShareParams();
		shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
		shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
		shareParams.setShareType(Platform.SHARE_VIDEO);
		platform.setPlatformActionListener(platformActionListener);
		platform.share(shareParams);
	} else {
		Toast.makeText(MobSDK.getContext(), "Client is not found or version low.", Toast.LENGTH_SHORT).show();
	}

}
 
Example 2
Source File: SdkTagsMainActivity.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
private void Sina() {
    ShareSDK.setEnableAuthTag(true);
    Platform plat = ShareSDK.getPlatform("SinaWeibo");
    plat.removeAccount(true);
    //plat.SSOSetting(false);
    plat.setPlatformActionListener(this);
    if (plat.isClientValid()) {

    }
    if (plat.isAuthValid()) {

    }
    //plat.authorize();	//要功能,不要数据
    plat.showUser(null);    //要数据不要功能,主要体现在不会重复出现授权界面
}
 
Example 3
Source File: SdkTagsMainActivity.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
private void WeChat() {
    Platform plat = ShareSDK.getPlatform(Wechat.NAME);
    ShareSDK.setEnableAuthTag(true);
    plat.removeAccount(true);
    //plat.SSOSetting(false);
    plat.setPlatformActionListener(this);
    if (plat.isClientValid()) {

    }
    if (plat.isAuthValid()) {

    }
    //plat.authorize();	//要功能,不要数据
    plat.showUser(null);    //要数据不要功能,主要体现在不会重复出现授权界面
}
 
Example 4
Source File: ShareMobLinkActivity.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPager(){
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    boolean clientBool = platform.isClientValid();
    if (clientBool) {
        Platform.ShareParams shareParams = new  Platform.ShareParams();
        shareParams.setText(LINK_TEXT);
        shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
        shareParams.setTitleUrl(LINK_URL);
        shareParams.setShareType(Platform.SHARE_WEBPAGE);
        platform.share(shareParams);
    } else {
        Toast.makeText(MobSDK.getContext(), "请先安装QQ客户端", Toast.LENGTH_LONG).show();
    }
}