content: package com.jwenfeng.pulltorefresh;
  
  import android.os.Handler;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  import com.jwenfeng.library.pulltorefresh.BaseRefreshListener;
  import com.jwenfeng.library.pulltorefresh.PullToRefreshLayout;
  import com.jwenfeng.library.pulltorefresh.State;
  
  public class WebviewActivity extends AppCompatActivity {
  
      private WebView webView;
      private PullToRefreshLayout pullToRefreshLayout;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_webview);
  
          webView = (WebView) findViewById(R.id.webview);
          pullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.activity_webview);
  
          webView.loadUrl("http://www.baidu.com/");
  
          webView.setWebViewClient(new WebViewClient(){
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                  view.loadUrl(url);
                  return true;
              }
          });
  
          pullToRefreshLayout.setRefreshListener(new BaseRefreshListener() {
              @Override
              public void refresh() {
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          pullToRefreshLayout.finishRefresh();
                      }
                  },2000);
              }
  
              @Override
              public void loadMore() {
                  new Handler().postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          pullToRefreshLayout.finishLoadMore();
                      }
                  },2000);
              }
          });
  
      }
  }
  