Closed complitech closed 6 years ago
Did you check Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)
?
What value does file.getAbsolutePath()
return?
What does Environment.getExternalStorageDirectory()
give you?
Hi @ocram
Yea media mounted true.
Here is path for my file :
mWebView.loadUrl("file:///storage/emulated/0/hensler_bone_press/index.html");
Hello,
I solved it by following way :
mWebView = (AdvancedWebView) findViewById(R.id.webview);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.loadUrl("file:///" + "sdcard/Android/data/android.webview.demo/abc/index.html");
Thanks for your response. (Y)
Glad you found a solution, and thanks a lot for sharing it!
This has now been added to the README so others will find it more easily in the future: https://github.com/delight-im/Android-AdvancedWebView/commit/e347b203b0b89498d7fb72099e21240ecbb3f11f
Hi, is there a way to load html file from sdcard ?
Like, mWebView.loadUrl("file:///android_asset/index.html");
I tried with following code but its not loading my html page :
mWebView.loadUrl("file://" + file.getAbsolutePath());