新浪微博API如何获取uid,并根据uid获取用户的基本信息,如粉丝,关注等,
下面是根据sdk写的,但是获取不到
public String showUser(Context context, String id)
throws MalformedURLException, IOException, WeiboException {
String rlt = "";
try {
Weibo mWeibo = Weibo.getInstance();
String url = Weibo.SERVER + "users/show.json";
Log.i("Weibo", "Weibo.showUser().url " + url);
WeiboParameters bundle = new WeiboParameters();
bundle.add("source", Weibo.getAppKey());
bundle.add("access_token", mWeibo.getAccessToken().getToken());
// bundle.add("access_token", Weibo.getInstance().getAccessToken()
// .getToken());
bundle.add("uid", id);
rlt = mWeibo.request(context, url, bundle, "GET",
mWeibo.getAccessToken());
Log.i("Weibo", "Weibo.showUser().rlt " + rlt);
} catch (Exception e) {
e.printStackTrace();
}