新浪微博中获取 自己关注人的最新微博 ,官方API文档提供的方法就是
 private  Weibo getWeibo(boolean isOauth,String[] args) {
Weibo weibo = new Weibo();
if(isOauth) {//oauth验证方式 args[0]:访问的token;args[1]:访问的密匙
weibo.setToken(args[0], args[1]);
}else {//用户登录方式
weibo.setUserId(args[0]);//用户名/ID
     weibo.setPassword(args[1]);//密码
}
return weibo;
}try {
//获取前20条关注用户的微博信息
List<Status> statuses = getWeibo(true,args).getFriendsTimeline();
for (Status status : statuses) {
            System.out.println(status.getUser().getName() + ":" +
                               status.getText());
        }
} catch (WeiboException e) {
e.printStackTrace();
}
为什么我的什么都不显示呢  能用吗?我是在android上用的

解决方案 »

  1.   

    android  新浪微博客户端怎么获取关注用户的头像呢???
      

  2.   

    套一下这个就可以了……private List<Status> getUserTimeline = null;
    private ImageView imageView;
    ……getUserTimeline = weibo.getUserTimeline();
    imageView=……;
    Drawable drawable = loadImageFromUrl(getUserTimeline .get(position).getUser().getProfileImageURL() .toString());imageView.setBackgroundDrawable(drawable);……
    public Drawable loadImageFromUrl(String url) { URL newUrl; InputStream is = null; Drawable drawable = null; try { newUrl = new URL(url); is = newUrl.openStream(); drawable = Drawable.createFromStream(is, "src"); } catch (MalformedURLException e1) { e1.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return drawable; }
      

  3.   


    我承认我很笨,能说的再详细一些吗?我是用listview显示的20
    个用户,怎么把所有用户的头像都显示出来
      

  4.   


    Thank you!
    是你启发了我!