浏览所有网站和所有链接都在同一webview中打开 [英] surfing all website and all links opens in same webview

查看:61
本文介绍了浏览所有网站和所有链接都在同一webview中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建webview应用程序以在同一webview上查看任何网站时,浏览器无法正常工作,但是当我单击该网站中的任何链接时,它会在浏览器中打开吗?当用户在同一Web视图上单击它们时,如何加载所有内部链接/页面/部分?

when I create webview application to view any website on same webview not browser it works fine but when I click on any link in that website it opens in browser ? how to load all internal links/pages/sections when user click on them at same webview ?

推荐答案

Java版本: 您只需为WebView设置一个WebViewClient,然后所有链接都将以相同的WebView打开:

Java version: You only need to set a WebViewClient for your WebView and then all links will be opened it the same WebView:

webView.setWebViewClient(new WebViewClient());

这篇关于浏览所有网站和所有链接都在同一webview中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆