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

This code example shows how to use the following methods: getContext, loadDataWithBaseURL, setBackgroundColor, setWebViewClient
	} 
	 
	 
    private void setup(){ 
    	 
    	String source = getSource(wv.getContext());
    	String html = source.replace("@src", url).replace("@color", Integer.toHexString(color));
    	 
    	wv.setWebViewClient(this);
    	 
    	//wv.setInitialScale(100); 
    	wv.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);
    	wv.setBackgroundColor(color);
    	 
    } 
	 
    private void done(WebView view){
    	if(progress != null){
			//progress.setVisibility(View.GONE); 
			view.setVisibility(View.VISIBLE);
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: getSettings, loadUrl, setWebViewClient
		super(activity);
 
		this.setTitle("Changelog");
 
		 
		WebView 	view 	 = new WebView(activity);
		WebSettings settings = view.getSettings();  
         
		settings.setJavaScriptEnabled(true);  
		settings.setAppCacheEnabled(false);
         
		view.setWebViewClient( new WebViewClient() {
			@Override 
			public void onPageStarted( WebView view, String url, Bitmap favicon ) {
				if( mLoader == null )
					mLoader = ProgressDialog.show( activity, "", "Loading changelog ..." );
				 
				super.onPageStarted(view, url, favicon);
			} 
 

10
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: getSettings, restoreState, setWebViewClient
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
     
    WebView browser=getBrowser();
     
    browser.setWebViewClient(new RedirectFixer());
    browser.getSettings().setJavaScriptEnabled(true);
     
    if (savedInstanceState!=null) {
      browser.restoreState(savedInstanceState);
    } 
    else if (urlToLoad!=null) {
      loadUrl(urlToLoad);
    } 
  } 
   
  @Override 
  public void onSaveInstanceState(Bundle state) {
    super.onSaveInstanceState(state);
     
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: getSettings, setWebChromeClient, setWebViewClient
This code example shows how to use the following methods: getSettings, loadUrl, setWebChromeClient, setWebViewClient
    mWebView = ((WebView) findViewById(R.id.webview));
    initWebView(); 
  } 
 
  private void initWebView() { 
    mWebView.setWebViewClient(new WebViewClient());
    mWebView.setWebChromeClient(new WebChromeClient());
    WebSettings settings = mWebView.getSettings();
    settings.setSavePassword(true);
    settings.setSaveFormData(true);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(false);
    settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    settings.setDomStorageEnabled(true);
    settings.setSupportMultipleWindows(false);
 
 
    mWebView.loadUrl("http://developer.android.com");
  } 
 

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: getSettings, setWebViewClient
 
    private GoogleAccountLogin(Activity activity, Account account,
            Runnable runnable) {
        mActivity = activity;
        mAccount = account;
        mWebView = new WebView(mActivity);
        mRunnable = runnable;
        mUserAgent = mWebView.getSettings().getUserAgentString();
 
        // XXX: Doing pre-login causes onResume to skip calling 
        // resumeWebViewTimers. So to avoid problems with timers not running, we 
        // duplicate the work here using the off-screen WebView. 
        CookieSyncManager.getInstance().startSync();
        WebViewTimersControl.getInstance().onBrowserActivityResume(mWebView);
 
        mWebView.setWebViewClient(new WebViewClient() {
            @Override 
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false; 
            } 
            @Override 
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: getSettings, loadUrl, setWebChromeClient, setWebViewClient
   
  @Override 
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    webView = new WebView(this);
    setContentView(webView);
     
    cookieManager = CookieManager.getInstance();     
     
    initWebClient(); 
  } 
   
  private void initWebClient() { 
    webView.getSettings().setJavaScriptEnabled(true);
     
    webView.setWebChromeClient(new WebChromeClient() {
      public void onProgressChanged(WebView view, int progress) {
        // progress measures don't match web client progress measures 
        GoogleAuthActivity.this.setProgress(progress * 100);

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: post, getSettings, setWebViewClient
		mLoadingSpinner = (ProgressBar) activity
				.findViewById(R.id.news_loading_spinner);
	} 
 
	public void setWebView(final String url) {
		webView.setWebViewClient(webClient);
		WebSettings settings = webView.getSettings();
		settings.setLightTouchEnabled(true);
		settings.setBuiltInZoomControls(true);
		webView.post(new Runnable() {
			public void run() { 
				if (CLEAR_CACHE_ON_LOAD) {
					webView.clearCache(true);
				} 
				webView.loadUrl(url);
			} 
		}); 
 
	} 
 
Full Snippet Info
6
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: post, getSettings, setWebViewClient
		this.url = url;
		setWebView(); 
	} 
 
	public void setWebView() { 
		WebSettings settings = webView.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setPluginsEnabled(true);
		settings.setLightTouchEnabled(true);
		webView.setWebViewClient(webClient);
		webView.post(new Runnable() {
			public void run() { 
				if (CLEAR_CACHE_ON_LOAD) {
					webView.clearCache(true);
				} 
				webView.loadUrl(url);
			} 
		}); 
 
	} 
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: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, getSettings, setLayoutParams, setWebViewClient
		 
		NMEWebView.HaxeListenerClass = _haxeListenerClass;
		 
		View view;
		 
		WebView webView = new WebView(GameActivity.getContext());
		webView.setVerticalScrollBarEnabled(false);
        webView.setHorizontalScrollBarEnabled(false);
		webView.setWebViewClient(new WebViewClient() {
			@Override 
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				NMEWebView.HaxeListenerClass.call1("onURLChanging", url);
				view.loadUrl(url);
				 
				return true; 
			} 
		}); 
		 
		WebSettings webSettings = webView.getSettings();
		webSettings.setSavePassword(false);

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related WebView setWebViewClient Questions & Answers:

Other WebView setWebViewClient Examples

23:			webview.loadUrl(page_url);
24:			
25:			webview.setWebViewClient(new DisPlayWebPageActivityClient());
26:		}
27:

Read More

setWebViewClient Method Overview
Sets the WebViewClient that will receive various notifications and requests.
See Code Examples for other Android WebView Methods: