1.下载QQ的SDK,导入jar包,android-support-v4,jar ,mta-sdk-1.0.0.jar ,open_sdk.jar三个jar包
2
2,配置AndroidManifest文件,http://wiki.connect.qq.com/%E5%88%9B%E5%BB%BA%E5%B9%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E7%A8%8B_android_sdk
<!-- 腾讯微博第三方登录 -->
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent你的appid" />
</intent-filter>
</activity>
//添加这个就是为了不用在调用的页面添加onActivityResult这个方法
<activity android:name="com.tencent.connect.common.AssistActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="orientation|keyboardHidden"
/>
3,如果this,有错误,则在this前面加上当前页面的Activity的名称,则没有错误
4,complete里面最好新开一个线程,否则因为Android主线程被占用的情况就会报错。
5,private class BaseUiListener implements IUiListener {
public void onComplete(JSONObject response) {
doComplete(response);
}
protected void doComplete(JSONObject values) {
}
}QQ回调会有两种情况。