在网页视图实现超时 [英] Implementing timeout in webviews

查看:313
本文介绍了在网页视图实现超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现超时我网页视图。我想告诉用户n错误消息,如果网页可能不是一个理想的时间内被加载。有没有办法做到这一点?

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

推荐答案

请参见的Andr​​oid的WebView超时
您basicly有通过调用的 getProgress()。如果进度hasen't特定的时间后达成你所选择的阈值,您拨打的错误消息。

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.

另一个答案:的http://groups.google.com/group/android-developers/browse_thread/thread/04a817864dc86383

这篇关于在网页视图实现超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆