开发者

Implementing timeout in webviews

开发者 https://www.devze.com 2023-04-11 03:50 出处:网络
I need to implement timeout for my webviews. I want to show the user n error message if the webpage could not be loaded withi开发者_JAVA百科n a desirable time. Is there any way to do this?See Android

I need to implement timeout for my webviews. I want to show the user n error message if the webpage could not be loaded withi开发者_JAVA百科n a desirable time. Is there any way to do this?


See Android WebView TimeOut You basicly have a timer that checks the progress of the webview at some time intervals by calling getProgress(). If the progress hasen't reached your chosen threshold value after a specific time you call the error message.

Another answer: http://groups.google.com/group/android-developers/browse_thread/thread/04a817864dc86383


You may use handler.postDelayed(Runnable r, int delayInMillisec) method after webview.loadUrl() or webview.loadDataWithBaseUrl()

0

精彩评论

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

关注公众号