Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使hf在WebView中可单击_Android - Fatal编程技术网

Android 使hf在WebView中可单击

Android 使hf在WebView中可单击,android,Android,我有此代码,我正在尝试将其设置为“此处”。可单击: // this is the html code in the file "<a href=\'https://secfirst.org/terms\'>here.</a>" //Load my html file webView.loadUrl("file:///android_res/drawable/terms.html"); 我知道错误是ERR\u FILE\u NOT\u FOUND,但这可能是因为u

我有此代码,我正在尝试将其设置为“此处”。可单击:

// this is the html code in the file
"<a href=\'https://secfirst.org/terms\'>here.</a>"
//Load my html file    
webView.loadUrl("file:///android_res/drawable/terms.html");
我知道错误是
ERR\u FILE\u NOT\u FOUND
,但这可能是因为url不起作用。知道如何修复吗?

更改:

"<a href=\'https://secfirst.org/terms\'>here.</a>"`
“”`



原因是html无效,因为双引号将被视为文本字符,而使用单引号的html的其余部分不需要在此处转义。因此,用单引号(
\'
)替换斜杠字符作为普通双引号(
)可以解决这个问题。

尝试将
改为
@petey,效果很好。我需要一杯咖啡,呵呵,这是我们中最好的一个。
"<a href=\'https://secfirst.org/terms\'>here.</a>"`
<a href="https://secfirst.org/terms">here.</a>