【发布时间】:2015-07-28 06:13:32
【问题描述】:
我正在使用基于 android webview 教程的创建应用程序。如何在实时android中获取本地文件。下面给出的编码对我有帮助。
String htmlData;
htmlData = "<link rel=\"stylesheet\" type=\"text/css\" href=\"Style.css\" />";
//lets assume we have /assets/style.css file
mWebView.loadDataWithBaseURL("file:///android_asset/", htmlData, "text/html", "UTF-8", null);
【问题讨论】: