将字符串添加到html并显示在webview中

时间:2017-02-06 15:14:23

标签: java android

我已在html文件夹中有一个名为myPage.html的{​​{1}}页面。就像这样......

assets

我需要在没有互联网连接时加载此<html> <body> Hello.... </body> </html> ,并在html中显示指向用户的链接。链接是动态的,所以 我无法在webview中对其进行硬编码。这是我用于链接的代码 -

html

因此要求是显示getDataFromServer() + "html/MyRules.html" @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { view.setBackgroundColor(0); view.loadUrl("file:///android_asset/myPage.html"); //Also display link in webview but how??? } 以及html中的链接。该链接应该是可点击的。我该怎么做?

0 个答案:

没有答案