简体   繁体   English

每次都有webView加载的活动

[英]Activity with webView Loading every time

In my app i have button when it clicked the app goes to another activity with webView to show HTML table The issue here is when i press back and return to the same activity the webView load agin and it take while how can i prevent it from loading over and over agin and will turnning the HTML table to listview will make it loade faster if yes . 在我的应用程序中,单击该应用程序时我有一个按钮,该应用程序将使用webView转到另一个活动以显示HTML表。这里的问题是当我按回并返回到webView加载开始的同一活动时,我需要花多长时间才能阻止它加载一遍又一遍,如果是的话,会将HTML表转换为listview将使其加载更快。 How ? 怎么样 ?

You can Preserving the state of an Android WebView on screen orientation change or activity is paused. 您可以在屏幕方向更改或活动暂停时保留Android WebView的状态。

If you've tried to use a WebView inside your app, you know that the standard behavior on screen orientation change is not satisfactory in most cases because the full state of the WebView is not preserved or similarly when your activity is pause same situation WebView will change their sate. 如果您尝试在应用程序内部使用WebView,则知道在大多数情况下,屏幕方向更改的标准行为并不令人满意,因为未保留WebView的完整状态,或者在活动暂停时,类似地,WebView会改变他们的状态。

possible implementation to keep the full state of the WebView here complete tutorial and code is given you can get idea from this code&tutorial 可能的实现,以保持WebView完整状态的完整教程和代码给出,您可以从此代码和教程中获得启发

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM