开发者

Call a webview inside another webview in android?

开发者 https://www.devze.com 2023-02-11 02:56 出处:网络
I have a custom html(suppose a.html) file which i am using from the resources and thus building a string with the entire document which is then passed to the WebView.

I have a custom html(suppose a.html) file which i am using from the resources and thus building a string with the entire document which is then passed to the WebView.

There's some text in a.html on click of which i want load ano开发者_Python百科ther file b.html in the webview itself.

Please let me know what is the apporach to be followed here.


Step #1: Implement a WebViewClient, overriding shouldOverrideURLLoading().

Step #2: In shouldOverrideURLLoading(), load what you want -- this will be called on link clicks and redirects, and you are supplied the URL that ordinarily would be loaded.


I think if you set a WebViewClient and override shouldOverrideUrlLoading() then you can have the link loaded into the current WebView by returning false.

0

精彩评论

暂无评论...
验证码 换一张
取 消