我有一个简单 webview 的代码,并且在运行代码时有效,但在 logcat 中显示错误“捕获安全异常”。这是什么意思?
WebActivity.java
public class WebActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
WebView mainWebView = (WebView) findViewById(R.id.mainWebView);
WebSettings webSettings = mainWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
mainWebView.setWebViewClient(new MyCustomWebViewClient());
mainWebView.loadUrl("http://google.com");
mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
}
private class MyCustomWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
日志猫
08-22 11:37:01.569: E/geolocationService(537): Caught security exception registering for location updates from system. This should only happen in DumpRenderTree.