statusesService.homeTimeline第一个参数它假定检索到的推文数量,但无论我传递给方法的数量是多少,我总是得到默认的推文数量,20。
public class FollowingActivity extends AppCompatActivity {
ListView homeList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_following);
homeList =(ListView)findViewById(R.id.homeList);
TwitterApiClient twitterApiClient = TwitterCore.getInstance().getApiClient();
StatusesService statusesService = twitterApiClient.getStatusesService();
statusesService.homeTimeline(200, null, null, null, null, null, null,//always the same number of tweets
new Callback<List<Tweet>>() {
@Override
public void success(Result<List<Tweet>> result) {
final FixedTweetTimeline timeline = new FixedTweetTimeline.Builder()
.setTweets(result.data)
.build();
final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter.Builder(FollowingActivity.this)
.setTimeline(timeline)
.build();
homeList.setAdapter(adapter);
}
public void failure(TwitterException exception) {
}
}
);
}
}