Is there a path similar to file:///android_asset/ that points to the apps directory?

柔情痞子 提交于 2019-12-03 03:09:14
gregm

Use this for files on the SD card:

content://com.android.htmlfileprovider

Use this for files in your assets directory:

file:///android_asset

Also, if you want to have all your references in your web view use that base directory set the baseUrl field like this, where "baseUrl" is the root directory as I mentioned above:

webview.loadDataWithBaseURL(
        baseUrl, htmlText, "text/html", "UTF-8", null);
guian

from android 2.1, they've added the

"file:///sdcard/..."

support for files on the sdcard

so :

loadUrl("file:///sdcard/path/to/my/file.html");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!