Java null pointer exception while using google maps in Android
<pre><code>package com.crumbin.tabs;

import java.util.ArrayList;
import java.util.HashMap;

import org.apache.http.client.HttpClient;

import android.content.Context;
import android.database.Cursor;
import android.location.Location;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.webkit.WebView;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;



public class ExploreActivity extends MapActivity {





  public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(com.app.main.R.layout.user_main_tab_explore);




        MapView mv = (MapView)findViewById(com.app.main.R.id.myMapView);
        mv.setBuiltInZoomControls(true);






      }

@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}

}


&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;

  &lt;com.google.android.maps.MapView
  android:id="@+id/myMapView"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:enabled="true"
  android:clickable="true"
  android:apiKey="Mykey"/&gt;
  &lt;/LinearLayout&gt;
</code></pre>

<p>This code gives me a java null pointer exception. I debugged it and found out that Mapview mv is null. </p>

<p>Shouldn't this code just display the map and no overlay/data on it? Or am I missing something here?</p>
