WebView canGoForward - 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 canGoForward method.

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);
7
CodeRank
This code example shows how to use the following methods:canGoBack, canGoForward, goBack, goForward, reload
 
	} 
 
	@Override 
	public void onClick(View v) {
		if (v.getId() == mBackButton.getId() && mWebView.canGoBack()) { // 上一頁
			mWebView.goBack();
		} else if (v.getId() == mForwardButton.getId() && mWebView.canGoForward()) { // 下一頁
			mWebView.goForward();
		} else if (v.getId() == mRefreshButton.getId()) { // 重新整理
			mWebView.reload();
		} 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:canGoBack, canGoForward, goBack, goForward
        } 
 
        @Override 
        public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
            int keyCode = event.getKeyCode();
            if ((keyCode == KeyEvent.KEYCODE_DPAD_LEFT) && view.canGoBack()) {
                view.goBack();
                return true; 
            } else if ((keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) && view.canGoForward()) {
                view.goForward();
                return true; 
            } 
            return false; 
        } 
 
        @Override 
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
        } 
 
6
CodeRank
This code example shows how to use the following methods:canGoForward, goForward
    		mWebView.goBack();
    	} 
    } 
     
    private void forward() { 
    	if(mWebView.canGoForward()) {
    		mWebView.goForward();
    	} 
    } 
     
    private void reload() { 
    	mWebView.reload();
    } 
     
    public void onClickGo(View v) {
    	go(mEditTextUrl.getText().toString());
    } 
     
    public void onClickBack(View v) {
    	back(); 
6
CodeRank
This code example shows how to use the following methods:canGoBack, canGoForward, goBack, goForward
			    
			   if((ke.getAction() == KeyEvent.ACTION_DOWN) &&
                       (keyCode==KeyEvent.KEYCODE_DPAD_LEFT))
			   { 
				   Log.i("key down","back");
				   if(wv.canGoBack())
				   { 
					   wv.goBack();
				   } 
			   } 
			    
			   if((ke.getAction() == KeyEvent.ACTION_DOWN) &&
                       (keyCode==KeyEvent.KEYCODE_DPAD_RIGHT))
			   { 
				   Log.i("key down","forward");
				   if(wv.canGoForward())
				   { 
					   wv.goForward();
				   } 
			   } 

6
CodeRank
This code example shows how to use the following methods:canGoForward, goForward
 
  /** 
   * Checks to see if it is possible to go forward one page in history, then does so. 
   */ 
  private void goForward() { 
    if (this.webview.canGoForward()) {
      this.webview.goForward();
    } 
  } 
 
  /** 
   * Navigate to the new page 
   *  
   * @param url to load 
   */ 
  private void navigate(String url) {    
    InputMethodManager imm = (InputMethodManager)this.ctx.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
    if (!url.startsWith("http")) {
      this.webview.loadUrl("http://" + url);      
5
CodeRank
This code example shows how to use the following methods:canGoForward, goForward
 
    /** 
     * Checks to see if it is possible to go forward one page in history, then does so. 
     */ 
    private void goForward() { 
        if (this.inAppWebView.canGoForward()) {
            this.inAppWebView.goForward();
        } 
    } 
 
    /** 
     * Navigate to the new page 
     * 
     * @param url to load 
     */ 
    private void navigate(String url) {
        InputMethodManager imm = (InputMethodManager)this.cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
 
        if (!url.startsWith("http") && !url.startsWith("file:")) {
5
CodeRank
This code example shows how to use the following methods:isFocused, canGoForward, goForward
			} 
		}); 
		bForward.setOnClickListener(new OnClickListener(){
			@Override 
			public void onClick(View arg0) {
				if (webView.isFocused() && webView.canGoForward()){
					webView.goForward();
				} 
			} 
		}); 
	} 
	 
	private void init(){ 
		bBack = (Button) findViewById(R.id.bBack);
		bBack.setText("<");
		bForward = (Button) findViewById(R.id.bForward);
		bForward.setText(">");
	} 
	 
	@Override 
5
CodeRank
This code example shows how to use the following methods:canGoForward, goForward
        } 
    } 
 
    public void goForwardHistory(View view)
    { 
        if(webBrowser.canGoForward())
        { 
            webBrowser.goForward();
        } 
    } 
 
    public void loadWebURL(View view)
    { 
        urlString = urlBar.getText().toString();
 
        if (!urlString.startsWith("http://"))
        { 
            urlString = "http://" + urlString;
        } 
 
5
CodeRank
This code example shows how to use the following methods:canGoForward
		mWebView.goBack();
	} 
 
	@Override 
	public boolean canGoForward() { 
		return mWebView.canGoForward();
	} 
 
	@Override 
	public void goForward() { 
		mWebView.goForward();
	} 
 
	@Override 
	public void reload() { 
		mWebView.reload();
	} 
 
	public void setBrowserController(InterstitialController controller) {
		if (mController != null) {
5
CodeRank

Related WebView canGoForward Questions & Answers:

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