{"id":138,"date":"2023-02-18T19:47:46","date_gmt":"2023-02-18T11:47:46","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=138"},"modified":"2023-02-18T19:51:18","modified_gmt":"2023-02-18T11:51:18","slug":"webview-loading-url-jumping-to-system-browser-solution","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/18\/webview-loading-url-jumping-to-system-browser-solution\/","title":{"rendered":"\u89e3\u51b3WebView\u52a0\u8f7dURL\u8df3\u8f6c\u5230\u7cfb\u7edf\u6d4f\u89c8\u5668\u7684\u95ee\u9898"},"content":{"rendered":"<h3>\u95ee\u9898\u63cf\u8ff0<\/h3>\n<p>WebView\u52a0\u8f7durl\u8df3\u8f6c\u5230\u7cfb\u7edf\u6d4f\u89c8\u5668\uff0c\u7528\u6237\u4f53\u9a8c\u975e\u5e38\u7684\u5dee<\/p>\n<p><!-- more --><\/p>\n<h3>\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<p>\u91cd\u5199<code>WebViewClient<\/code>\u7684<code>shouldOverrideUrlLoading(WebView view, String url)<\/code>\uff0c\u4f7f\u7528<code>view.loadUrl(url)<\/code>\u52a0\u8f7durl<\/p>\n<pre><code class=\"language-java\">WebView webView = (WebView) findViewById(R.id.webView);\nwebView.getSettings().setJavaScriptEnabled(true);\nwebView.loadUrl(&quot;http:\/\/www.baidu.com&quot;);\nwebView.setWebViewClient(new WebViewClient() {\n@Override\npublic boolean shouldOverrideUrlLoading(WebView view, String url) {\n    view.loadUrl(url);\n    return super.shouldOverrideUrlLoading(view, url);\n    }\n});<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 WebView\u52a0\u8f7durl\u8df3\u8f6c\u5230\u7cfb\u7edf\u6d4f\u89c8\u5668\uff0c\u7528\u6237\u4f53\u9a8c\u975e\u5e38\u7684\u5dee \u89e3\u51b3\u65b9\u6cd5 \u91cd\u5199WebViewClient [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[67],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-android-basic","tag-webview"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}