1

Trouble in loading local html file from asset into a webview. HTML page has javascript code, so I have used webview.setJavaScriptEnabled(true) to enable it. It loads the html page, but not all the widgets properly. Any suggestions...

Manjunath
  • 2,063
  • 2
  • 29
  • 60

1 Answers1

3
public class ViewWeb extends Activity {  

        public void onCreate(Bundle savedInstanceState) {  
            super.onCreate(savedInstanceState);
            setContentView(R.layout.webview);  
            WebView wv;  
            wv = (WebView) findViewById(R.id.webView1);  
            wv.loadUrl("file:///android_asset/hello.html");   
        }  
    }
Ketan Parmar
  • 2,962
  • 19
  • 27
  • I did exactly the same, and even enabled the Javascript for the webview. But, I have a folder which has an HTML page and many javascript files linked to it. It displays the HTML page but, rendering the images is not happening properly. – Manjunath Sep 12 '12 at 09:12