app/src/main/java/com/codepath/apps/restclienttemplate/TimelineActivity.java
// get tweets from timeline using the client GET, makes sure to stop the refreshing animation when done
get tweets from timeline using the client GET, makes sure to stop the refreshing animation when done
get tweets from timeline using the client GET makes sure to stop the refreshing animation when done
public void fetchTimelineasync(int page) {
        client.getHomeTimeline(new JsonHttpResponseHandler() {
            @Override
            public void onSuccess(int statusCode, Headers headers, JSON json) {
                adapter.clear();
                try {
                    adapter.addAll(Tweet.fromJsonArray(json.jsonArray));
                } catch (JSONException e) {
                    Log.e(TAG, "fetchTimelineasync: " + e.toString());
                }
                srlTimelineRefresh.setRefreshing(false);
            }
            @Override
            public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {
                Log.d(TAG, "Fetch timeline error: " + throwable.toString());
            }
        });
    }
public void fetchTimelineasync ( int page ) { client . getHomeTimeline ( new JsonHttpResponseHandler ( ) { @ Override public void onSuccess ( int statusCode , Headers headers , JSON json ) { adapter . clear ( ) ; try { adapter . addAll ( Tweet . fromJsonArray ( json . jsonArray ) ) ; } catch ( JSONException e ) { Log . e ( TAG , "fetchTimelineasync: " + e . toString ( ) ) ; } srlTimelineRefresh . setRefreshing ( false ) ; } @ Override public void onFailure ( int statusCode , Headers headers , String response , Throwable throwable ) { Log . d ( TAG , "Fetch timeline error: " + throwable . toString ( ) ) ; } } ) ; }
get tweets from timeline using the client GET, makes sure to stop the refreshing animation when done
get tweets from timeline using the client GET makes sure to stop the refreshing animation when done
// Replace adapter items with new refreshed items