Android WebView goback() problem using loaddatawithbaseurl method

The problem is that goback () does not display my HTML data. The steps that cause this problem are like

>Use the method loaddatawithbaseurl to load HTML data. It makes the HTML data very good. > then click a link in the HTML data, and then move the WebView to the next page to display the link, which is also good. > when I call the method goback() from this page, it should display my HTML data, but it displays my blank screen. In onpagefinished(), the web address I get is: blank

Thank you in advance!

resolvent:

If you use loaddatawithbaseurl, you need to send a URL parameter different from null. If you send null, the URL will always be "about: Blank"

Example:

var page = new RazorView().GenerateString();
webView.LoadDataWithBaseURL("file:///android_asset/", page, "text/html", "UTF-8", "");
var url = webView.CopyBackForwardList().GetItemAtIndex(1).Url; 
//url  will get the Html From PrevIoUs Page

Note that I use C # but it should be the same as Java, except capitalized words

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>