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

This code example shows how to use the following methods:getUrl, saveState
    } 
  } 
 
  @Override 
  protected void onSaveInstanceState(Bundle state) {
    String url = webView.getUrl();
    if (url != null && url.length() > 0) {
      webView.saveState(state);
      state.putBoolean(WEBVIEW_STATE_PRESENT, true);
    } 
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
8
CodeRank
This code example shows how to use the following methods:getOriginalUrl, getSettings, getUrl
    public DownloadTouchIcon(Tab tab, Context ctx, ContentResolver cr, WebView view) {
        mTab = tab;
        mContext = ctx.getApplicationContext();
        mContentResolver = cr;
        // Store these in case they change. 
        mOriginalUrl = view.getOriginalUrl();
        mUrl = view.getUrl();
        mUserAgent = view.getSettings().getUserAgentString();
    } 
 
    /** 
     * Use this ctor to download the touch icon and update the bookmarks database 
     * entry for the given url. Used when the user creates a bookmark from 
     * within the bookmarks activity and there haven't been any redirects. 
     * TODO: Would be nice to set the user agent here so that there is no 
     * potential for the three different ctors here to return different icons. 
     */ 
    public DownloadTouchIcon(Context ctx, ContentResolver cr, String url) {
        mTab = null;
        mContext = ctx.getApplicationContext();
7
CodeRank
This code example shows how to use the following methods:getUrl, saveState
    doneButton.setOnClickListener(doneListener);
  } 
 
  @Override 
  protected void onSaveInstanceState(Bundle state) {
    String url = webView.getUrl();
    if (url != null && url.length() > 0) {
      webView.saveState(state);
      state.putBoolean(WEBVIEW_STATE_PRESENT, true);
    } 
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
7
CodeRank
This code example shows how to use the following methods:getUrl
 
	@Override 
	public Result execute(String... args) {
		CalabashChromeClient ccc = CalabashChromeClient.findAndPrepareWebViews().get(0);
		WebView webView = ccc.getWebView();
		return new Result(true, webView.getUrl());
	} 
 
	@Override 
	public String key() {
		return "get_url"; 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:canGoBack, getUrl, goBack, loadUrl
 
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if ((keyCode == KeyEvent.KEYCODE_BACK) && isStartPage()) {
			// on quit application.. 
			// getMetrics here... 
			System.out.println("com.manuelmaly.mockingdroid.monitor: " + this.monitor.getMetrics(webview.getUrl()));
 
			if (this.lastBackPressTime < System.currentTimeMillis() - 2000) {
				backToast = Toast.makeText(this, "Press back again to end this session!", Toast.LENGTH_SHORT);
				backToast.show();
				this.lastBackPressTime = System.currentTimeMillis();
				return true; 
			} else { 
				if (backToast != null)
					backToast.cancel();
				return super.onKeyDown(keyCode, event); // let app handle back button (activity end)
			} 
		} else if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
			if (backButtonGloballyAllowed && currentPageBackButtonAllowed) {
				if (currentPageBackButtonURL != null) {

6
CodeRank
This code example shows how to use the following methods:getParent, getUrl, loadUrl, setWebViewClient
		return loader;
	} 
 
	@Override 
	public void onLoadFinished(Loader<WebView> loader, WebView data) {
		FrameLayout parent = (FrameLayout) data.getParent();
		if (parent != null) {
			parent.removeView(data);
		} 
		 
		FrameLayout view = (FrameLayout) mFragment.getView();
		view.addView(data);
		 
		String url = "http://fbsearch.muik.net";
		 
		data.setWebViewClient(new BasicWebViewClient(mLoading));
		if (!url.equals(data.getUrl())) {
			data.loadUrl(url);
		} 
	} 

6
CodeRank
This code example shows how to use the following methods:getContext, getUrl
			} 
		}); 
 
		webView.setWebChromeClient(new WebChromeClient() {
			public void onProgressChanged(WebView view, int progress) {
				Activity a = (Activity) view.getContext();
				a.setTitle("Loading...");
				a.setProgress(progress * 100);
				if (progress == 100)
					a.setTitle(view.getUrl());
			} 
		}); 
		webView.loadUrl(intent.getStringExtra(Const.REDIRECT_URI));
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:getUrl, loadUrl
   * @param jsCode JavaScript code to execute. 
   */ 
  public static void executeJs(final WebView webview,
      JavascriptResultNotifier notifier, final String jsCode) {
    resNotifier = notifier;
    if (webview.getUrl() == null) {
      return; 
    } 
    webview.loadUrl("javascript:" + jsCode);
  } 
 
  /** 
   * Callback to report results of JavaScript code execution. 
   * 
   * @param result Results (if returned) or an empty string. 
   */ 
  public void resultAvailable(String result) {
    resNotifier.notifyResultReady(result);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:getUrl, saveState
    } 
  } 
 
  @Override 
  protected void onSaveInstanceState(Bundle state) {
    String url = webView.getUrl();
    if (url != null && url.length() > 0) {
      webView.saveState(state);
      state.putBoolean(WEBVIEW_STATE_PRESENT, true);
    } 
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
5
CodeRank
This code example shows how to use the following methods:getOriginalUrl, getSettings, getUrl
 
    public DownloadTouchIcon(ContentResolver cr, Cursor c, WebView view) {
        mContentResolver = cr;
        mCursor = c;
        // Store these in case they change. 
        mOriginalUrl = view.getOriginalUrl();
        mUrl = view.getUrl();
        mUserAgent = view.getSettings().getUserAgentString();
    } 
 
    public DownloadTouchIcon(ContentResolver cr, Cursor c, String url) {
        mContentResolver = cr;
        mCursor = c;
        mOriginalUrl = null;
        mUrl = url;
        mUserAgent = null;
    } 
 
    @Override 
    public Bitmap doInBackground(String... values) {
5
CodeRank

Related WebView getUrl Questions & Answers:

getUrl Method Overview
Gets the URL for the current page.
See Code Examples for other Android WebView Methods: