- public class MyWebViewClient extends WebViewClient {
- boolean timeout;
- public MyWebView() {
- timeout = true;
- }
- @Override
- public void onPageStarted(WebView view, String url, Bitmap favicon) {
- new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- if(timeout) {
- // do what you want
- }
- }
- }).start();
- }
- @Override
- public void onPageFinished(WebView view, String url) {
- timeout = false;
- }
- http://blog.csdn.net/dreamer0924/article/details/8640797
- }
转载于:https://www.cnblogs.com/wcLT/p/8012725.html