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

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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setScrollbarFadingEnabled, getSettings, setMapTrackballToArrowKeys, setScrollBarStyle
        initWebViewSettings(w);
        return w;
    } 
 
    protected void initWebViewSettings(WebView w) {
        w.setScrollbarFadingEnabled(true);
        w.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
        w.setMapTrackballToArrowKeys(false); // use trackball directly
        // Enable the built-in zoom 
        w.getSettings().setBuiltInZoomControls(true);
        final PackageManager pm = mContext.getPackageManager();
        boolean supportsMultiTouch =
                pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)
                || pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT);
        w.getSettings().setDisplayZoomControls(!supportsMultiTouch);
 
        // Add this WebView to the settings observer list and update the 
        // settings 
        final BrowserSettings s = BrowserSettings.getInstance();
        s.startManagingSettings(w.getSettings());

8
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getSettings, loadUrl, setBackgroundColor
		@Override 
		public void onCreate(Bundle state)
		{ 
			super.onCreate(state);
 
			WebView view = new WebView(this);
			view.getSettings().setJavaScriptEnabled(true);
			view.loadUrl("file:///android_asset/about.html");
			view.setBackgroundColor(Color.TRANSPARENT);
			setContentView(view);
		} 
	} 
 
	@TargetApi(11) 
	public static class AboutFragment extends WebViewFragment {
		@Override 
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{ 
			WebView view = (WebView)super.onCreateView(inflater, container, savedInstanceState);
			view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Full Snippet Info
7
CodeRank
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java

Related WebView getSettings Questions & Answers:

Other WebView getSettings Examples

20:			
21:			webview = (WebView) findViewById(R.id.webpage);
22:			webview.getSettings().setJavaScriptEnabled(true);
23:			webview.loadUrl(page_url);
24:

Read More

getSettings Method Overview
Gets the WebSettings object used to control the settings for this WebView.
See Code Examples for other Android WebView Methods: