title: why does the items on layout can't be used in class?
body: <p>I'm trying a project I got in internet, but when I imported it on Eclipse Juno, the items in activity_main.xml can't be used.
  here is the activity_main.xml code`</p>
  
  <pre><code>&lt;RelativeLayout 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;      
  
      &lt;Button 
          android:id="@+id/btn_find"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" 
          android:text="@string/str_btn_find" 
          android:layout_alignParentRight="true" /&gt;
  
      &lt;EditText
          android:id="@+id/et_location"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"        
          android:inputType="text" 
          android:hint="@string/hnt_et_location"
          android:layout_toLeftOf="@id/btn_find" /&gt;
  
  &lt;/RelativeLayout&gt;
  
   &lt;com.google.android.maps.MapView        
      android:id="@+id/map_view"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:apiKey="02XkocQETlvu36mzmDnwYr-A4GTX5mENmESOG8A"
      android:clickable="true" /&gt;
  </code></pre>
  
  <p>`</p>
  
  <p>And here is the code for MainActivity.java
  `</p>
  
  <pre><code>import java.io.IOException;
  import java.util.List;
  
  import android.R;
  import android.graphics.drawable.Drawable;
  import android.location.Address;
  import android.location.Geocoder;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  
  import com.google.android.maps.GeoPoint;
  import com.google.android.maps.MapActivity;
  import com.google.android.maps.MapController;
  import com.google.android.maps.MapView;
  import com.google.android.maps.Overlay;
  import com.google.android.maps.OverlayItem;
  
  public class MainActivity extends MapActivity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // Getting reference to btn_find of the layout activity_main
      Button btn_find = (Button) findViewById(R.id.btn_find);
  
      // Defining button click event listener for the find button
      OnClickListener findClickListener = new OnClickListener() {         
          @Override
          public void onClick(View v) {
              // Getting reference to EditText to get the user input location
              EditText etLocation = (EditText) findViewById(R.id.et_location);
  
              // Getting user input location
              String location = etLocation.getText().toString();
  
              if(location!=null &amp;&amp; !location.equals("")){
                  new GeocoderTask().execute(location);
              }
          }
      };
  
      // Setting button click event listener for the find button
      btn_find.setOnClickListener(findClickListener);     
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_main, menu);
      return true;
  }
  
  @Override
  protected boolean isRouteDisplayed() {
      // TODO Auto-generated method stub
      return false;
  }   
  
  // An AsyncTask class for accessing the GeoCoding Web Service
  private class GeocoderTask extends AsyncTask&lt;String, Void, List&lt;Address&gt;&gt;{
  
      @Override
      protected List&lt;Address&gt; doInBackground(String... locationName) {
          // Creating an instance of Geocoder class
          Geocoder geocoder = new Geocoder(getBaseContext());
          List&lt;Address&gt; addresses = null;
  
          try {
              // Getting a maximum of 3 Address that matches the input text
              addresses = geocoder.getFromLocationName(locationName[0], 3);
          } catch (IOException e) {
              e.printStackTrace();
          }           
          return addresses;
      }
  
  
      @Override
      protected void onPostExecute(List&lt;Address&gt; addresses) {
  
          // Getting Reference to MapView of the layout activity_main
          MapView mapView = (MapView) findViewById(R.id);
  
          // Setting ZoomControls
          mapView.setBuiltInZoomControls(true);
  
          // Getting MapController for the MapView
          MapController mc = mapView.getController();
  
  
          // Getting Drawable object corresponding to a resource image
          Drawable drawable = getResources().getDrawable(R.drawable.marker);
  
  
          // Getting Overlays of the map
          List&lt;Overlay&gt; overlays = mapView.getOverlays();
  
          // Creating an ItemizedOverlay
          LocationOverlay locationOverlay = new LocationOverlay(drawable,getBaseContext());
  
          // Clearing the overlays
          overlays.clear();
  
          if(addresses==null || addresses.size()==0){
              Toast.makeText(getBaseContext(), "No Location found", Toast.LENGTH_SHORT).show();
  
              // Redraws the map to clear the overlays
              mapView.invalidate();
          }
  
          // Adding Markers on Google Map for each matching address
          for(int i=0;i&lt;addresses.size();i++){                
  
              Address address = (Address) addresses.get(i);
  
              // Creating an instance of GeoPoint, to display in Google Map
              GeoPoint p = new GeoPoint(
                                        (int)(address.getLatitude()*1E6),
                                        (int)(address.getLongitude()*1E6)
                                       );
  
              String addressText = String.format("%s, %s",
                      address.getMaxAddressLineIndex() &gt; 0 ? address.getAddressLine(0) : "",
                      address.getCountryName());
  
  
              // Creating an OverlayItem to mark the point
              OverlayItem overlayItem = new OverlayItem(p, "Location",addressText);
  
              // Adding the OverlayItem in the LocationOverlay
              locationOverlay.addOverlay(overlayItem);
  
              // Adding locationOverlay to the overlay
              overlays.add(locationOverlay);
  
              // Locate the first location
              if(i==0)
                  mc.animateTo(p);                    
          }
  
          // Redraws the map
          mapView.invalidate();
  
      }       
  }
  </code></pre>
  
  <p>}`</p>
  
  <p>The error shows something wrong on the line like "R.layout.activity_main", "Button btn_find = (Button) findViewById(R.id.btn_find)". activity_main and btn_find and another R.id.x marked as the error.
  What's the problem there? Thanks.</p>