Hi everybody,
Have been going through the HelloWebView tutorial. First I did all the
coding my self. Went perfectly fine. Loaded the Google address. Then I
added the code for HelloWebViewClient. As soon as I added the
webview.setWebViewClient(new HelloWebViewClient()); I end up getting
nothing but black in the content area.
After working a bit with it, I reversed everything, and copied the
code from the tutorial. Same behaviour. If I take the aforementioned
line of code out, then it works again.
Does anyone have a clue to why this is happening?
Kind regards,
Christer
public class HelloWebView extends Activity {
/** Called when the activity is first created. */
private WebView webview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.setWebViewClient(new HelloWebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://www.google.com");
}
private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String
url) {
view.loadUrl(url);
return true;
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---