content: package com.jwenfeng.pulltorefresh;
  
  import android.os.Handler;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  
  import com.jwenfeng.library.pulltorefresh.BaseRefreshListener;
  import com.jwenfeng.library.pulltorefresh.PullToRefreshLayout;
  import com.jwenfeng.library.pulltorefresh.State;
  
  public class ScrollViewActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_scrollview);
  
          final PullToRefreshLayout p = (PullToRefreshLayout) findViewById(R.id.activity_scrollview);
          p.setRefreshListener(new BaseRefreshListener() {
              @Override
              public void refresh() {
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          p.finishRefresh();
                      }
                  },2000);
              }
  
              @Override
              public void loadMore() {
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          p.finishLoadMore();
                      }
                  },2000);
              }
          });
      }
  }
  