Code example for Button

Methods: setEnabled

0
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (url.startsWith("file")) {
        // Keep local assets in this WebView. 
        return false; 
      } else { 
        // Open external URLs in Browser. 
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        return true; 
      } 
    } 
  } 
}