title: Trying to add a Refresh Method to a WebView and having issues
body: <p>I'm trying to add a simple swipe refresh to a webview layout. I have searched all over and tried different methods from things that I have found on GitHub and Android Developers pages but nothing seems to work. When I load the web page with the code without the OnRefresh method in the code it loads just fine. But as soon as I enable the method the page just closes the application. Any advice would be great as I'm new to android (1 yr exp) and trying to learn. Thanks</p>
  <p>Here is a sample of the code I'm working with. Hope I don't post to much info every time I ask a question here I get told I'm posting too much!!</p>
  <pre><code>
  private AboutViewModel AboutViewModel;
  SwipeRefreshLayout swipe;
  
  public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View root;
      AboutViewModel = new ViewModelProvider(this).get(AboutViewModel.class);
          root = inflater.inflate(R.layout.fragment_about, container, false);
  
          WebView webView = root.findViewById(R.id.web_view_about);
          webView.loadUrl(&quot;https://example.com&quot;);
          webView.setWebViewClient(new WebViewController());
  
      swipe = (SwipeRefreshLayout) container.findViewById(R.id.swipe);
      swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
              webView.reload();
          }
      });
      return root;
  }
  </code></pre>
  <p>This is the layout xml</p>
  <pre><code>&lt;androidx.swiperefreshlayout.widget.SwipeRefreshLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:id=&quot;@+id/swipe&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;WebView
          android:id=&quot;@+id/web_view_about&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot; /&gt;
  
  &lt;/androidx.swiperefreshlayout.widget.SwipeRefreshLayout&gt;
  </code></pre>