Recipe Customizing a Web Browser

There are two ways to obtain a Webview object. It can be instantiated from the constructor: WebView webview = new WebView(this);

Alternatively, a Webview can be used in a layout and declared in the activity: WebView webview = (WebView) findViewByld(R.id.webview);

After the object is retrieved, a web page can be displayed using the loadURL() method: webview.loadUrl("http://www.google.com/");

The WebSettings class can be used to define the features of the browser. For example, network images can be blocked in the browser to reduce the data loading using the set-BlockNetworklmage() method.The font size of the displayed web content can be set using the setDefaultFontSize() method. Some other commonly used settings are shown in the example:

WebSettings webSettings = webView.getSettings();

webSettings.setSaveFormData(false);

webSettings.setJavaScriptEnabled(true);

webSettings.setSavePassword(false);

webSettings.setSaveFormData(false);

webSettings.setJavaScriptEnabled(true);

webSettings.setSupportZoom(true);

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment