PhoneGap keep running on Android after onPause

前端 未结 2 1055
情书的邮戳
情书的邮戳 2020-12-06 00:37

I decided to test if phonegap WebView is live when app is in a background.

function test2(x){
    $(\'
\', {text: x.cmd}).appendTo($(\'
相关标签:
2条回答
  • 2020-12-06 01:00

    I am late with response. In phonegap there is KeepRunning param in config.xml

    You must add following line to config.xml

    <platform name="android">
        ...
        <preference name="KeepRunning" value="false" />
    

    It will call pauseTimers() and pause all WebViews. pauseTimers() is not hidden method and no reflection is needed.

    0 讨论(0)
  • 2020-12-06 01:24

    This should help: WebView threads never stop (WebViewCoreThread, CookieSyncManager, http[0-3])

    Basically you have to use reflection to access the WebView's onPause/onResume methods to really make it pause and resume.

    0 讨论(0)
提交回复
热议问题