title: Android: Cannot cast from View to MapView
body: <p>I'm trying to run the Android MapView example, and am getting a 'Cannot cast from View to MapView' error in Eclipse.</p>
  
  <p>My layout is as follows</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/mainlayout"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" &gt;
  
  &lt;com.google.android.maps.MapView
      android:id="@+id/mapview"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:clickable="true"
      android:apiKey="0jwi0saLYCPGfO-t7glg5bQoBz7jVKWCcgyQWQA"
   /&gt;
  
  &lt;LinearLayout
      android:id="@+id/zoomview"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@id/mapview"
      android:layout_centerHorizontal="true"
  /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and the Activity code is</p>
  
  <pre><code>package org.gaz.mapapp;
  
  import android.os.Bundle;
  import android.view.View;
  import android.widget.LinearLayout;
  import android.widget.ZoomControls;
  
  import com.google.android.maps.*;
  
  public class MapView extends MapActivity {
  
  LinearLayout linearLayout;
  MapView mapView;
  ZoomControls mZoom;
  
  public void onCreate(Bundle savedInstance) {
      linearLayout = (LinearLayout) findViewById(R.id.mainlayout);
      mapView = (MapView) findViewById(R.id.mapview);
      mZoom = (ZoomControls) mapView.getZoomControls();       
  }
  
  @Override
  protected boolean isRouteDisplayed() {
      // TODO Auto-generated method stub
      return false;
  }
  }
  </code></pre>
  
  <p>The error is caused by the line</p>
  
  <pre><code>mapView = (MapView) findViewById(R.id.mapview);
  </code></pre>
  
  <p>Can anybody offer an suggestions as to a fix?</p>
  
  <p>Cheers,
  Gaz.</p>