<span style="font-size:14px;">(<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">1)需要到腾讯开发平台里面注册,创建应用获取appid和appkey。</span></span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><span style="font-size:14px;">(2)需要加上</span></span>
public void addQZoneQQPlatform() {
String appId = "xxx";
String appKey = "xxx";
// 添加QQ支持, 并且设置QQ分享内容的target url
UMQQSsoHandler qqSsoHandler = new UMQQSsoHandler(ct, appId, appKey);
qqSsoHandler.setTargetUrl(Api.HOST_UMENG);
qqSsoHandler.addToSocialSDK();
// 添加QZone平台
QZoneSsoHandler qZoneSsoHandler = new QZoneSsoHandler(ct, appId, appKey);
qZoneSsoHandler.addToSocialSDK();
}
如果会显示QQ没有在sdk中配置
(3)当用户退出的时候一定要解除绑定,否则当换了另一个QQ登陆的时候,还是以原来的QQ进行登陆。
<span style="font-size:12px;">public void logout(final SHARE_MEDIA platform) {
mController.deleteOauth(ct, platform, new SocializeClientListener() {
@Override
public void onStart() {
}
@Override
public void onComplete(int status, SocializeEntity entity) {
String showText = "解除" + platform.toString() + "平台授权成功";
if (status != StatusCode.ST_CODE_SUCCESSED) {
showText = "解除" + platform.toString() + "平台授权失败[" + status
+ "]";
}
Toast.makeText(ct, showText, Toast.LENGTH_SHORT).show();
}
});
}</span>
(4)在Umeng的demo中的CustomPlatformFragment.java中有QQ登陆和和QQ解除登陆的例子;