Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b99d136f authored by Trevor Johns's avatar Trevor Johns
Browse files

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
parent 1415bb7a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ we'll create a simple Activity that can view web pages.</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?>
&lt;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">

    &lt;WebView 
@@ -69,7 +69,7 @@ private class HelloWebViewClient extends WebViewClient {

   <li>Now, in the <code>onCreate()</code> method, set an instance of the <code>HelloWebViewClient</code>
   as our WebViewClient:
      <pre>webview.setWebViewClient(new WebViewClientDemo());</pre>
      <pre>webview.setWebViewClient(new HelloWebViewClient());</pre>

      <p>This line should immediately follow the initialization of our WebView object.</p>
      <p>What we've done is create a WebViewClient that will load any URL selected in our