Use onOptionItemSelected if you use a Menu.
Also look a Menus guide and an Example : How to use menus.
And using a WebView required INTERNET permission, add below into AndroidManifest.xml.
<uses-permission android:name="android.permission.INTERNET" />
Also you can try enabling webview JS.
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
UPDATE
First of all change your code
//menu click event
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.action_settings:
mWebView.loadUrl("http://www.google.com");
case R.id.career_trend:
mWebView.loadUrl("http://www.google.com");
}
return true;
}
TO
//menu click event
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.action_settings:
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
return true;
case R.id.career_trend:
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
return true;
}
return true;
}
Secondary - make sure that your webview is present on screen. I mean is visible...
Third - check INTERNET PERMISSION in your manifest file.
and LAST! - make sure that your menu click listener is working. Just put Log into onOptionItemSelected
method and check that he printed.
Also look WEB VIEW EXAMPLE : http://www.mkyong.com/android/android-webview-example/