public void LoadOldTimelineData( com.sina.weibo.sdk.auth.Oauth2AccessToken acccessToken, long since_id, long max_id, final int count, int page) { StatusesAPI statusesAPI = new StatusesAPI(MainActivity.getToken()); // final MainActivity mainActivity = new MainActivity(); setReady(false); // 重置ready值,直到读取完毕 getStatuses_list().clear(); statusesAPI.homeTimeline( since_id, max_id, count, page, false, FEATURE.ALL, false, myListener // new RequestListener() { // // public void onComplete(String response) { // // TODO Auto-generated method stub // ProcessWeibo(response); // } // // public void onComplete4binary( // ByteArrayOutputStream responseOS) { // // TODO Auto-generated method stub // // } // // public void onIOException(IOException e) { // // TODO Auto-generated method stub // // } // // public void onError(WeiboException e) { // // TODO Auto-generated method stub // // } // // } ); }
public void getUserTimelineData( String UserName, com.sina.weibo.sdk.auth.Oauth2AccessToken acccessToken, long since_id, long max_id, final int count, int page) { StatusesAPI statusesAPI = new StatusesAPI(MainActivity.getToken()); getUser_statuses_list().clear(); setReady(false); // 重置ready值,直到读取完毕 if (null != UserName) { // 读取指定的帐号微博 statusesAPI.userTimeline( UserName, since_id, max_id, count, page, false, FEATURE.ALL, false, new RequestListener() { public void onIOException(IOException e) { // TODO Auto-generated method stub } public void onError(WeiboException e) { // TODO Auto-generated method stub } public void onComplete4binary(ByteArrayOutputStream responseOS) { // TODO Auto-generated method stub } public void onComplete(String response) { // TODO Auto-generated method stub ProcessWeibo(response, getUser_statuses_list()); } }); } else { // 读取当前登陆的帐号微博 statusesAPI.userTimeline( since_id, max_id, count, page, false, FEATURE.ALL, false, new RequestListener() { public void onIOException(IOException e) { // TODO Auto-generated method stub } public void onError(WeiboException e) { // TODO Auto-generated method stub } public void onComplete4binary(ByteArrayOutputStream responseOS) { // TODO Auto-generated method stub } public void onComplete(String response) { // TODO Auto-generated method stub ProcessWeibo(response, getUser_statuses_list()); } }); } }