Reputation: 1191
I am trying to show the html files in /storage/sdcard0/...
WebView engine = (WebView) (findViewById(R.id.webView1));
engine.setWebViewClient(new WebViewClient());
engine.loadUrl(Environment.getExternalStorageDirectory().getPath() + "testing.html");
but the webpage failed to display.... Can anybody help? Thanks!
Upvotes: 1
Views: 2789
Reputation: 2719
Use
engine.loadUrl("file:///"+Environment.getExternalStorageDirectory().getAbsolutePath() + "testing.html");
Upvotes: 2
Reputation: 1191
SOLVED!!! should add "file:///" in the front =]=]
engine.loadUrl("file:///" +
Environment.getExternalStorageDirectory().getPath() +
"testing.html");
Upvotes: 7