Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.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 WebView html href值格式_Android - Fatal编程技术网

Android WebView html href值格式

Android WebView html href值格式,android,Android,我的片段中有一个webview。一个HTML字符串被加载到其中。该字符串包含链接标记:“” 然后我为我的webview设置了一个webviewclient webview.setWebViewClient(new WebViewClient() { // you tell the webclient you want to catch when a url is about to load @Override public

我的片段中有一个webview。一个HTML字符串被加载到其中。该字符串包含链接标记:
“”
然后我为我的webview设置了一个webviewclient

webview.setWebViewClient(new WebViewClient() {
            // you tell the webclient you want to catch when a url is about to load
            @Override
            public boolean shouldOverrideUrlLoading(WebView  view, String  url){
                Logger.d("url="+url);

                return true;
            }
            // here you execute an action when the URL you want is about to load
            @Override
            public void onLoadResource(WebView  view, String  url){
                Logger.d("url="+url);

            }
        });
我的问题是,如果单击该链接,我的WebViewClient将无法捕获它。 但是如果我将其更改为
,那么它将工作,因为href值是一个有效链接。 我想要实现的是将任何href值放入并捕获它。我也没有访问这里的任何网站。只想捕获任意文本并执行其他操作。

字符串url=”https://www.google.com" 您是否在android清单中授予网络权限?

字符串url=”https://www.google.com"
你是否在android清单中授予了网络权限?

与任何权限无关