title: Reload a webview after turning on internet
body: <p>I am trying to load a url into a webview. If there is internet connection, it should load it to the webview. Otherwise, a try again screen should be shown. In the try again screen, i have a try again button. If we click on it, the url should be loaded again. But with the code i've done, the app keeps crashing when i try to reload the url by clicking on try again button(even after i turn on net or if its still off). This is my code</p>
  
  <pre><code>    tryAgainButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              tryAgainLayout.setVisibility(View.GONE);
              browser = (WebView)findViewById(R.id.webView1);
              open(browser);
          }
      });
  
  
  
  private void open(View view){
      browser.getSettings().setLoadsImagesAutomatically(true);
      browser.getSettings().setJavaScriptEnabled(true);
      browser.getSettings().setAppCacheEnabled(true);
      browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
      browser.getSettings().setSupportMultipleWindows(true);
      browser.setWebViewClient(new MyBrowser());
      browser.setWebChromeClient(new MyCustomChromeClient());
      mContext=this.getApplicationContext();
      browser.loadUrl(target_url);
      MainActivity.this.progressBar.setProgress(0);
      browser.setDownloadListener(new DownloadListener() {
          public void onDownloadStart(String url, String userAgent,
                                      String contentDisposition, String mimetype,
                                      long contentLength) {
              Intent intent = new Intent(Intent.ACTION_VIEW);
              intent.setData(Uri.parse(url));
              startActivity(intent);
          }
      });
  }
  </code></pre>
  
  <p>How can i reload the page on clicking on the try again button.</p>