调用下面的登录API时,Eclipse提示错误:
mTencent.login(getActivity(), "all", new ShareListener());
错误提示为:
The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files
不知是何原因?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
android.support.v4.jar版本不一致冲突了吧
用 QQAuth 类来实现登录功能。
主要代码如下:
import com.tencent.connect.auth.QQAuth;
import com.tencent.tauth.IUiListener;
import org.json.JSONObject;
import org.json.JSONException;
private QQAuth mQQAuth = null;
private IUiListener mListenerForQQLogin = null;
mQQAuth = QQAuth.createInstance(QQ_APP_ID, (Context)mAppActivity);
mListenerForQQLogin = new IUiListener() {
};
if (mQQAuth != null && !mQQAuth.isSessionValid())
{
}