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

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:goForward
		return mWebView.canGoForward();
	} 
 
	@Override 
	public void goForward() { 
		mWebView.goForward();
	} 
 
	@Override 
	public void reload() { 
		mWebView.reload();
	} 
 
	public void setBrowserController(InterstitialController controller) {
		if (mController != null) {
			mController.hide();
		} 
		mController = controller;
		attachController(); 
	} 
5
CodeRank
This code example shows how to use the following methods:canGoForward, goForward
			break; 
		case MENU_REFRESH:
			webview.reload();
			break; 
		case MENU_FORWARD:
			if(webview.canGoForward())
				webview.goForward();
		break; 
		} 
		return true; 
    } 
     
    void toggleGotoVisibility() 
    { 
    	if (urlBar.getVisibility() == View.GONE)
    	{ 
    		urlBar.setVisibility(View.VISIBLE);
    	} 
    	else 
    	{ 
4
CodeRank

Related WebView goForward Questions & Answers:

goForward Method Overview
Goes forward in the history of this WebView.
See Code Examples for other Android WebView Methods: