WebView canGoBack - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebView canGoBack method.

This code example shows how to use the following methods: canGoBack, goBack
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
    return super.onKeyDown(keyCode, event);
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: canGoBack, goBack
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
    return super.onKeyDown(keyCode, event);
  } 
 
  private final class HelpClient extends WebViewClient {
    @Override 
    public void onPageFinished(WebView view, String url) {
      setTitle(view.getTitle());
      backButton.setEnabled(view.canGoBack());
    } 
 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: canGoBack, canGoForward
            view.loadUrl(url);
            return true; 
        } 
         
        public void handleHistoryChange() { 
            activity.setTitleButtonEnabled("back", mWebView.canGoBack());
            activity.setTitleButtonEnabled("forward", mWebView.canGoForward());
        } 
    }	 
 
    //Handle the back key 
    @Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (mWebView != null) {
            if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
                mWebView.goBack();
                return true; 
            } 
        } 
        return super.onKeyDown(keyCode, event);
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: canGoBack, goBack
    mWebView.loadUrl("http://developer.android.com");
  } 
 
  @Override 
  public void onBackPressed() { 
    if (mWebView.canGoBack())
      mWebView.goBack();
    else 
      super.onBackPressed(); 
  } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: canGoBack, goBack
 
    //Handle the back key 
    @Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (mWebView != null) {
            if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
                mWebView.goBack();
                return true; 
            } 
        } 
        return super.onKeyDown(keyCode, event);
    } 
 
    @Override 
    public void onClick(View v) {
        String tag = (String)v.getTag();
        if ("refresh".equals(tag)) {
            mWebView.reload();
        } 
        else if ("back".equals(tag)) {
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related WebView canGoBack Questions & Answers:

Other WebView canGoBack Examples

28:		@Override
29:		public boolean onKeyDown(int keyCode, KeyEvent event) {
30:		    if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
31:		    	webview.goBack();
32:		        return true;

Read More

canGoBack Method Overview
Gets whether this WebView has a back history item.
See Code Examples for other Android WebView Methods: