Code example for WebView: Displaying local web pages

Methods: addJavascriptInterfacegetSettingsloadDatasetWebChromeClientsetWebViewClient

0
        setContentView(R.layout.projects);
         
        webViewStats = (WebView) findViewById(R.id.webView_nepal_stats);
        pb = (ProgressBar) findViewById(R.id.progressbar); 
         
        webViewStats.getSettings().setJavaScriptEnabled(true);
         
        //loads the WebView completely zoomed out 
        webViewStats.getSettings().setLoadWithOverviewMode(true);
        //webViewMapNepal.getSettings().setUseWideViewPort(true); 
        webViewStats.setWebViewClient(new MyWebViewClient());
        webViewStats.setWebChromeClient(new MyWebChromeClient());
        webViewStats.addJavascriptInterface(new JavaScriptInterface(this), "Android");
        webViewStats.loadData(Text.URL_UNDP_NEPAL_PROJECTS, "text/html", "utf-8");
         
        webViewStats.setWebViewClient(new WebViewClient(){
        	 
        	@Override 
        	public void onPageFinished(WebView view, String url) {
        		super.onPageFinished(view, url);
        		System.out.println("onPageFinished");
Stop searching for code, let great code find you!  Add Codota to your java IDE