title: Issue Creating simple WebView Android
body: <p>OK - so I typically develop for iOS but have a client who needs a hand in a pinch. </p>
  
  <p>I followed a tutorial, which was very straightforward and helpful. I created everything as it had asked me to (or maybe I didn't - which is why I'm here). </p>
  
  <p>Any help would be greatly appreciated. We are really in a bind here!</p>
  
  <p>You're welcome to come in over join.me as well and take a look. I think it could be something incredibly simple that I am too ignorant/inexperienced with this platform to see. </p>
  
  <p><a href="http://www.tutorialspoint.com/android/android_webview_layout.htm" rel="nofollow">http://www.tutorialspoint.com/android/android_webview_layout.htm</a></p>
  
  <p>The issue could be very simple. On these lines, I am getting errors which Eclipse will not override:</p>
  
  <pre><code>  setContentView(R.layout.activity_main);
    field = (EditText)findViewById(R.id.urlField);
    browser = (WebView)findViewById(R.id.webView1);
  </code></pre>
  
  <p>Error is "R cannot be resolved to a variable</p>
  
  <p>Here is my MainActivity.java </p>
  
  <pre><code>package com.example.WebView;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.view.View;
  import android.view.Window;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class MainActivity extends Activity {
  
     private EditText field;
     private WebView browser;
  
     @Override        
     protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        field = (EditText)findViewById(R.id.urlField);
        browser = (WebView)findViewById(R.id.webView1);
        browser.setWebViewClient(new MyBrowser());
     }
  
  
     public void open(View view){
        String url = field.getText().toString();
        browser.getSettings().setLoadsImagesAutomatically(true);
        browser.getSettings().setJavaScriptEnabled(true);
        browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        browser.loadUrl("http://www.magiktab.com/app");
  
     }
     private class MyBrowser extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
           view.loadUrl("http://www.magiktab.com/app");
           return true;
        }
     }
  
  
     }
  </code></pre>
  
  <p>Here is my activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:paddingBottom="@dimen/activity_vertical_margin"
     android:paddingLeft="@dimen/activity_horizontal_margin"
     android:paddingRight="@dimen/activity_horizontal_margin"
     android:paddingTop="@dimen/activity_vertical_margin"
     tools:context=".MainActivity" &gt;
  
     &lt;TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" /&gt;
  
     &lt;EditText
        android:id="@+id/urlField"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:ems="10" /&gt;
  
     &lt;Button
        android:id="@+id/button1" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/urlField"
        android:layout_centerHorizontal="true"
        android:onClick="open"
        android:text="@string/browse" /&gt;
  
     &lt;WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView1"
        android:layout_alignParentBottom="true"
        android:layout_below="@+id/button1" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And of course, my manifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.webview"
     android:versionCode="1"
     android:versionName="1.0" &gt;
  
     &lt;uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" /&gt;
     &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
     &lt;application
        android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" &gt;
        &lt;activity
       android:name="com.example.webview.MainActivity"
       android:label="@string/app_name" &gt;
       &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
  
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>