title: implement webview on fragment
body: <p>I'm trying to implement webview on a fragment. I'm using this with backwards compatibility (support.v4.app) so I can't extend to <code>WebViewFragment</code>.</p>
  
  <p>I'm starting with fragments and I've never used Webview, si I'm not very sure of how is this programed. </p>
  
  <p>This is my layout <strong>web_view.xml</strong>:</p>
  
  <pre><code>&lt;LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="horizontal" 
  android:baselineAligned="false"&gt;
  
  &lt;WebView
          android:id="@+id/webview_container"
          android:layout_width="fill_parent"        
          android:layout_height="fill_parent" /&gt;    
  </code></pre>
  
  <p></p>
  
  <p>And this is the <strong>WebView class</strong>:</p>
  
  <pre><code>public class WebView extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View mainView = inflater.inflate(R.layout.web_view, container, false);
  
          WebView webView = (WebView) mainView.findViewById(R.id.webview_container);  ERROR 1
          webView.getSettings().setJavaScriptEnabled(true);  //ERROR 2
          webView.setWebViewClient(new SwAWebClient());  //ERROR 3
          webView.loadUrl("http://maps.google.com");  //ERROR 4
  
      return mainView;
  }
  </code></pre>
  
  <p><strong>ERROR 1</strong>: Cannot cast from view to webview</p>
  
  <p><strong>ERROR 2</strong>: The method getSettings() is undefined for the type WebView</p>
  
  <p><strong>ERROR 3</strong>: The method setWebViewClient() is undefined for the type WebView</p>
  
  <p><strong>ERROR 4</strong>: The method loadUrl() is undefined for the type WebView</p>