protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView
wv = (WebView) findViewById(R.id.webView1);
wv.loadUrl("https://www.google.com");
}
Solution
1. Make sure the permission is granted
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
2. Make sure the following bold content in your code
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView
wv = (WebView) findViewById(R.id.webView1);
wv.setWebViewClient(new WebViewClient(){});
wv.loadUrl("https://www.google.com");
}
沒有留言:
張貼留言