80,350
社区成员
发帖
与我相关
我的任务
分享
public Boolean requestAccessToken(Activity activity, String callBackUrl) {
Boolean flag = false;
try {
httpOauthConsumer = new CommonsHttpOAuthConsumer(APP_KEY,
APP_SECRET);
Log.d("yinan", "1");//////////////////////////////////
httpOauthprovider = new DefaultOAuthProvider(
"http://api.t.sina.com.cn/oauth/request_token",
"http://api.t.sina.com.cn/oauth/access_token",
"http://api.t.sina.com.cn/oauth/authorize");
Log.d("yinan", httpOauthprovider.toString() );//////////////////////////////////
String authUrl = httpOauthprovider.retrieveRequestToken(
httpOauthConsumer, callBackUrl);
Log.d("yinan", "3");//////////////////////////////////
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse(authUrl)));
Log.d("yinan", "4");//////////////////////////////////
flag = true;
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}