Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetScrollBarStylesetWebViewClient

0
        ActionBar ab = getSupportActionBar();
        ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        ab.setDisplayShowTitleEnabled(true);
 
        mWebView = (WebView) findViewById(R.id.webView);
        mWebView.setWebViewClient(new UshahidiWebClient());
        mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        mWebView.getSettings().setUserAgentString(USER_AGENT);
        mWebView.getSettings().setBuiltInZoomControls(true);
        mWebView.setScrollBarStyle(android.view.View.SCROLLBARS_INSIDE_OVERLAY);
 
        // load URL if one was provided in the intent 
        String url = getIntent().getStringExtra("url");
        if (url != null) {
            loadUrl(url);
        } 
    } 
 
    /** 
     * Load the specified URL in the Webview. 
     *  
     * @param url URL to load in the Webview. 
     */ 
    protected void loadUrl(String url) {
        mWebView.loadUrl(url);
    } 
 
    @Override 
    public void onBackPressed() {