title: Android - WebView canGoBack() always returns false?
body: <p>Why does <code>WebView canGoBack()</code> always return false?</p>
  
  <pre><code>if (myWebView.canGoBack()) 
         { myWebView.goBack(); } //always false
  </code></pre>
  
  <p>onCreate:</p>
  
  <pre><code>        WebSettings webSettings = myWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
          webSettings.setBuiltInZoomControls(true);
          myWebView.loadUrl( getString(R.string.base_url) );
          myWebView.setWebViewClient(new MyWebViewClient(progress));
  </code></pre>
  
  <p>MyWebviewClient:</p>
  
  <pre><code>public class MyWebViewClient extends WebViewClient {
      private ProgressBar progressBar;
  
      public MyWebViewClient(ProgressBar progressBar) {
          this.progressBar=progressBar;
          progressBar.setVisibility(View.VISIBLE);
      }
  
      @Override
      public void onPageStarted(WebView view, String url, Bitmap favicon) {
          progressBar.setVisibility(View.VISIBLE);
          share_btn.setVisibility(View.GONE);
          back_btn.setVisibility(View.GONE);
          super.onPageStarted(view, url, favicon);
      }
  
      @Override
      public void onPageFinished(WebView view, String url) {
          super.onPageFinished(view, url);
          // TODO Auto-generated method stub
          progressBar.setVisibility(View.GONE);
          //hide loading image
          findViewById(R.id.imageLogo).setVisibility(View.GONE);
          //show webview
          findViewById(R.id.websiteView).setVisibility(View.VISIBLE);
          toolbar.setVisibility(View.VISIBLE);
          currentURL = url.replace("mapp.","");
          if(url.contains("article")) {
              share_btn.setVisibility(View.VISIBLE);
              back_btn.setVisibility(View.VISIBLE);
          }
      }
  
      @SuppressWarnings("deprecation")
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          if (!Global.IsInternetConnected(MainActivity.this))
              Toast.makeText(getApplicationContext(), "No internet connection!", Toast.LENGTH_SHORT).show();
          else
              view.loadUrl(url);
          return true;
      }
  
      @TargetApi(Build.VERSION_CODES.N)
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
          if (!Global.IsInternetConnected(MainActivity.this))
              Toast.makeText(getApplicationContext(), "No internet connection!", Toast.LENGTH_SHORT).show();
          else {
              view.loadUrl(request.getUrl().toString());
          }
          return true;
      }
  }
  </code></pre>
  
  <p>It's working fine on the emulator pixel_XL_API_25 but not working neither <strong>Samsung S6</strong> nor <strong>Note3</strong>.</p>