机器人的WebView - 第一LoadData()工作正常,后续调用不更新显示机器人、正常、工作、LoadData

2023-09-04 08:36:48 作者:甘心沦陷

要LoadData第一个呼叫后()onLoadResource火灾,因为它应该和显示器是罚款的事件。接下来,我要刷新的屏幕采用了新的一页,当我使用LoadData()的第二次页面没有更新和onLoadResource()不火。

After the 1st call to LoadData() the event onLoadResource fires as it should and the display is fine. Next I want to refresh the screen with a new page, when I use LoadData() the second time the page does not update and onLoadResource() DOES NOT FIRE.

要LoadData()onlyfires onPageFinished ... onPageStarted然后第二个电话永远不会触发!

Then second call to LoadData() onlyfires onPageFinished ... onPageStarted never fires!

有一个变通方法是LoadData(后打电话到.reload的()),但是这会导致各种问题,在活动的其他逻辑期间。

A work around was to call .reload() after LoadData() but that causes all sorts of problems during the other logic in the activity.

为什么不LoadData()工作多次?

Why doesn't LoadData() work multiple times?

我使用非常简单的HTML,并且由于使用.reload的(),使得它的工作我LoadData()语句似乎并不成为问题。

I am using extremely simple HTML, and since using .reload() makes it work my LoadData() statement doesn't seem to be the problem.

任何想法将是有益的,TIA

Any Ideas would be helpful, TIA

推荐答案

使用

webview.loadDataWithBaseURL("same://ur/l/tat/does/not/work", "data", "text/html", "utf-8", null);

它工作正常。 loaddata 没有刷新数据加载下一次。

it works fine. loaddata does not refresh next time the data is loaded.