app/src/main/java/com/codepath/apps/restclienttemplate/TimelineActivity.java
private void loadMoreData() {
        client.getNextPageOfTweets(new JsonHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Headers headers, JSON json) {
                Log.i(TAG, "onSuccess of loadMoreData");
                JSONArray jsonArray = json.jsonArray;
                try {
                    List<Tweet> tweets = Tweet.fromJsonArray(jsonArray);
                    // appends new tweets to adaptor
                    adaptor.addAll(tweets);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            @Override
            public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {
                Log.i(TAG, "onFailure of loadMoreData", throwable);
            }
        }, tweets.get(tweets.size() - 1).id);
    }
// loads more data for infinite scroll
loads more data for infinite scroll
loads more data for infinite scroll
private void loadMoreData() {
        client.getNextPageOfTweets(new JsonHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Headers headers, JSON json) {
                Log.i(TAG, "onSuccess of loadMoreData");
                JSONArray jsonArray = json.jsonArray;
                try {
                    List<Tweet> tweets = Tweet.fromJsonArray(jsonArray);
                    adaptor.addAll(tweets);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            @Override
            public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {
                Log.i(TAG, "onFailure of loadMoreData", throwable);
            }
        }, tweets.get(tweets.size() - 1).id);
    }
private void loadMoreData ( ) { client . getNextPageOfTweets ( new JsonHttpResponseHandler ( ) { @ Override public void onSuccess ( int statusCode , Headers headers , JSON json ) { Log . i ( TAG , "onSuccess of loadMoreData" ) ; JSONArray jsonArray = json . jsonArray ; try { List < Tweet > tweets = Tweet . fromJsonArray ( jsonArray ) ; adaptor . addAll ( tweets ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } @ Override public void onFailure ( int statusCode , Headers headers , String response , Throwable throwable ) { Log . i ( TAG , "onFailure of loadMoreData" , throwable ) ; } } , tweets . get ( tweets . size ( ) - 1 ) . id ) ; }
loads more data for infinite scroll
loads more data for infinite scroll
// appends new tweets to adaptor