Beginner Android why is "id" is "Unknown member" with R.id?
<p>I'm sure this is something dead simple as it's my first android app with code (the hello world example I did was just assigning a value to a string in XML).  My problem is when trying to get the reference for my button in my variable then the id as in R.id is not defined?</p>

<p>The compiler error is in a comment in the code below where it occurs: </p>

<pre><code>package com.geeksonhugs.simplecalc;

import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class MainActivity extends Activity
{
    private Button AddButton;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        AddButton = (Button)findViewById(R.id.btnAdd);
//"Unknown member 'id' of 'com.geeksonhugs.simplecalc.R'"

        //AddButton.setOnClickListener(this);

    }   

}
</code></pre>

<p>XML layout file:</p>

<pre><code>&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LayoutRoot" 
    android:layout_height="match_parent" 
    android:layout_width="match_parent" 
    android:orientation="vertical"&gt;

&lt;TextView 
    android:id="@+id/txtFirstNum" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="@string/strFirstNum" /&gt;

&lt;EditText 
    android:id="@+id/edtFirstNum" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="" /&gt;

&lt;TextView 
    android:id="@+id/txtSecondNum" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="@string/strSecondNum" /&gt;

&lt;EditText 
    android:id="@+id/edtSecondNum" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="" /&gt;

&lt;Button 
    android:id="@+id/btnAdd" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="@string/strAdd" 
    android:gravity="center" /&gt;

&lt;TextView 
    android:id="@+id/txtResult" 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text="" /&gt;

&lt;/LinearLayout&gt;
</code></pre>
