From b99d136f255d9f9270d4d1e224bd48030a9e6fb2 Mon Sep 17 00:00:00 2001 From: Trevor Johns Date: Thu, 20 Jan 2011 13:04:17 -0800 Subject: [PATCH] Fixing bugs in HelloWebView tutorial on developer.android.com. - Top-level LinearLayout needs to fill_parent, rather than wrap_content, otherwise the child WebView has 0 width - setWebViewClient() needs to construct a new HelloWebViewClient, not WebViewClientDemo (which doens't exist). Change-Id: Ie8b14e0cbf2b498573e965ccfc27b858dedabfa0 --- docs/html/guide/tutorials/views/hello-webview.jd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd index c4388ea6ff118..a927b0497dde8 100644 --- a/docs/html/guide/tutorials/views/hello-webview.jd +++ b/docs/html/guide/tutorials/views/hello-webview.jd @@ -12,8 +12,8 @@ we'll create a simple Activity that can view web pages.

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
     android:orientation="vertical">
 
     <WebView 
@@ -69,7 +69,7 @@ private class HelloWebViewClient extends WebViewClient {
 
    
  • Now, in the onCreate() method, set an instance of the HelloWebViewClient as our WebViewClient: -
    webview.setWebViewClient(new WebViewClientDemo());
    +
    webview.setWebViewClient(new HelloWebViewClient());

    This line should immediately follow the initialization of our WebView object.

    What we've done is create a WebViewClient that will load any URL selected in our