Bug solution for android app webview being loaded due to adding js
A few days ago, when developing a program, I found that the webview of an application is always loading html5 pages. loading is slow or cannot be loaded,
However, there is no problem in other applications, and it can be loaded quickly. I found the cause of the problem, and my head was too big to find it. Today, I heard from the web browser that it may be
Js. Add mWebView. pauseTimers () to onpause and mWebView. resumeTimers () to onResume ().
Miraculously solved the problem and is currently investigating why ....
@ Override protected void onPause () {super. onPause (); mWebView. pauseTimers (); if (isFinishing () {mWebView. loadUrl ("about: blank"); setContentView (new FrameLayout (this) ;}@ Override protected void onResume () {super. onResume (); mWebView. resumeTimers ();}