希望这是一个简单的问题,我遇到了这个问题,我的产生的某种过程被称为“ProgressTracker”,导致我的webview不断刷新内部2-3分钟。我正在尝试制作一个静态菜单板,所以页面不断刷新让我发疯。当我通过ADT在我的设备上运行Eclipse中的代码时,这种情况没有发生,但是当我将它集成到固件文件中时,它确实...
是否只有一个简单的设置可以禁用这个烦人的错误?
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
D/ProgressTracker( 871): Progress incremented (0x41b13918) - value 0.884891, tracked frames 1
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
F/Debug ( 871): Json: true
F/Debug ( 871): State=1
F/Debug ( 871): CurTS: 1401976422 OldTS: 1401976422
Webview配置:
/** Configure WebView */
webview0 = new WebView(getApplicationContext());
webview0.setWebViewClient(new WebViewer());
webview0.getSettings().setUserAgentString("-1");
webview0.getSettings().setLoadWithOverviewMode(true);
webview0.getSettings().setUseWideViewPort(true);
webview0.getSettings().setDomStorageEnabled(true);
webview0.getSettings().setJavaScriptEnabled(true);
webview0.getSettings().setPluginState(PluginState.ON);
webview0.getSettings().setRenderPriority(RenderPriority.HIGH);
// webview0.getSettings().setMediaPlaybackRequiresUserGesture(false);
webview0.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webview0.getSettings().setAllowFileAccess(true);
webview0.getSettings().setAppCacheEnabled(true);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
webview0.getSettings().setAppCachePath(appCachePath);
WebViewClient:
public class WebViewer extends WebViewClient {
private boolean alreadyLoaded = false;
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
if (alreadyLoaded)
return;
alreadyLoaded = true;
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// view.loadUrl(url);
return true;
}
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:(function() { document.getElementsByTagName('video')[0].play(); })()");
}
}