简体   繁体   中英

URL not loading in WebView properly

I have a WebView that I want to point to a certain URL. For some reason the following code just opens the regular Android browser. I want it to load in my webview.

webView =  (WebView) this.findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");

I followed this example and it worked:

http://marakana.com/forums/android/examples/58.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM