屮
这做的什么破SDK
都是没毕业的学生做的吧
看看人家Sina做的
在看看你们做的
草
还TM弹出授权成功。。。
找了一遭才找到
然后。
重写
package dc.sdk.weibo.activity;然后,TencentAuthListener那把原来的授权页替换成现在的,manifest那改掉
import android.content.Context;
import android.widget.Toast;
import com.tencent.weibo.sdk.android.component.Authorize;
import dc.sdk.weibo.common.Global;
import dc.sdk.weibo.db.domain.Token;
import dc.sdk.weibo.service.AuthService;
/**
* 用户授权组件
*
*/
public class TencentAuthorize extends Authorize {
/**
*
* 获取授权后的返回地址,并对其进行解析
*/
public void jumpResultParser(String result) {
String resultParam = result.split("#")[1];
String params[] = resultParam.split("&");
String accessToken = params[0].split("=")[1];
String expiresIn = params[1].split("=")[1];
String openid = params[2].split("=")[1];
String openkey = params[3].split("=")[1];
String refreshToken = params[4].split("=")[1];
String state = params[5].split("=")[1];
String name = params[6].split("=")[1];
String nick = params[7].split("=")[1];
Context context = this.getApplicationContext();
if (accessToken != null && !"".equals(accessToken)) {
//TODO 屮
Token t = new Token( name, accessToken, Long.parseLong(expiresIn), nick, refreshToken, openid, openkey, System.currentTimeMillis() / 1000l, Global.AUTH_TYPE_TENCENT);
AuthService.writeAccessToken(context, t);
Toast.makeText(TencentAuthorize.this, "授权成功!", Toast.LENGTH_SHORT).show();
this.finish();
isShow = true;
}
}
}
/* (non-Javadoc)搞定
* @see com.tencent.weibo.sdk.android.component.sso.OnAuthListener#onWeiBoNotInstalled()
*/
@Override
public void onWeiBoNotInstalled() {
Logger.w(context, context.getString(R.string.auth__client_uninstall));
AuthHelper.unregister(context);
Intent i = new Intent(context,TencentAuthorize.class);
context.startActivity(i);
}
/* (non-Javadoc)
* @see com.tencent.weibo.sdk.android.component.sso.OnAuthListener#onWeiboVersionMisMatch()
*/
@Override
public void onWeiboVersionMisMatch() {
Logger.w(context, context.getString(R.string.auth__client_version_old));
AuthHelper.unregister(context);
Intent i = new Intent(context,TencentAuthorize.class);
context.startActivity(i);
}
dog day tencent
dog day huateng-ma
--
senRsl
2014-04-04 14:26
GMT+8 @Beijing Tongzhou
senRsl
2014-04-04 14:26
GMT+8 @Beijing Tongzhou
没有评论 :
发表评论