private void onQQLoginClick() {
// 这里的逻辑和官方文档一样
tencent = Tencent.createInstance(Config.QQ_APP_ID, this);
if (!tencent.isSessionValid()) {
tencentLoginListener = new IUiListener() {
@Override
public void onComplete(Object o) {
org.json.JSONObject obj = (org.json.JSONObject) o;
Log.i(TAG, "#onComplete " + obj);
}
@Override
public void onError(UiError uiError) {
Log.i(TAG, "#onError " + uiError.errorMessage);
}
@Override
public void onCancel() {
Log.i(TAG, "#onCancel 取消");
}
};
tencent.login(this, "all", tencentLoginListener);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//注意回调------↓↓↓
if(requestCode == Const↓ants.RESULT_LOGIN) {
Tencent.onActivityResultData(requestCode, resultCode, data, tencentLoginListener);
}
}
QQ第三方登陆后不走回调
最新推荐文章于 2021-11-16 20:46:54 发布