Set loadURLTImeOutValue on WebView

前端 未结 6 1124
我在风中等你
我在风中等你 2020-11-29 06:32

I\'m working with PhoneGap and Android and have my .html and js files on an external server. When I use the following code, the app loads my external .html files and everyt

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 07:09

    If you extend CordovaWebView, which you should in order to get the phonegap API, you can just use the following:

    this.getIntent().putExtra("loadUrlTimeoutValue", 60000);
    

    Internally, CordovaWebView implements a timeout mechanism similar to the ones proposed in the previous post (default timeout = 2000).

    Mind that this is not a documented interface, so it might break in the future.

提交回复
热议问题