spinner cannot be resolved or is not a field
<p>I am studying ApiDemos sample in SDK 
and trying to separate Menu example(App/Menu/Inflate from Menu-MenuInflateFromXml.java).</p>

<pre><code>package my.android.Menu;


import my.android.Menu.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class MyMenu extends Activity {

    /**
     * Different example menu resources.
     */
    private static final int sMenuExampleResources[] = {
        R.menu.title_only, R.menu.title_icon, R.menu.submenu, R.menu.groups,
        R.menu.checkable, R.menu.shortcuts, R.menu.order, R.menu.category_order,
        R.menu.visible, R.menu.disabled
    };

    /**
     * Names corresponding to the different example menu resources.
     */
    private static final String sMenuExampleNames[] = {
        "Title only", "Title and Icon", "Submenu", "Groups",
        "Checkable", "Shortcuts", "Order", "Category and Order",
        "Visible", "Disabled"
    };

    /**
     * Lets the user choose a menu resource.
     */
    private Spinner mSpinner;

    /**
     * Shown as instructions.
     */
    private TextView mInstructionsText;

    /**
     * Safe to hold on to this.
     */
    private Menu mMenu;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

     // Create a simple layout
        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);   


     // Create the spinner to allow the user to choose a menu XML
        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_spinner_item, sMenuExampleNames); 
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mSpinner = new Spinner(this);

        // When programmatically creating views, make sure to set an ID
        // so it will automatically save its instance state


        mSpinner.setId(R.id.spinner);//Error Line
        mSpinner.setAdapter(adapter);


        setContentView(R.layout.main);
    }
}
</code></pre>

<p>IDE show this error "spinner cannot be resolved or is not a field", i can't go head.
i did't see any XML file which include "spinner".</p>
