Map zoom closes program
<p>Making a simple map app, plan on adding buttons to mark specific locations</p>

<p>But right now it crashes when I zoom.</p>

<pre><code>import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;


import android.graphics.drawable.Drawable;
import android.os.Bundle;

public class Main extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    MapView mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);

    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();
    Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
    MyItemizedOverlay itemizedoverlay = new MyItemizedOverlay(drawable);

    GeoPoint point = new GeoPoint(19240000,-99120000);
    OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");

    itemizedoverlay.addOverlay(overlayitem);
    mapOverlays.add(itemizedoverlay);
    }



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

<p>When I touch the built in zoom, it forces the application to close.</p>

<p>Any help would be great.</p>

<p>edit: Stacktrace</p>

<pre><code>12-16 05:40:04.012: D/dalvikvm(2473): GC_FOR_MALLOC freed 4578 objects / 277208 bytes in 49ms
12-16 05:40:04.151: I/MapActivity(2473): Handling network change notification:CONNECTED
12-16 05:40:04.151: E/MapActivity(2473): Couldn't get connection factory client
12-16 05:40:04.271: D/dalvikvm(2473): GC_FOR_MALLOC freed 3049 objects / 271640 bytes in 49ms
12-16 05:40:08.491: D/AndroidRuntime(2473): Shutting down VM
12-16 05:40:08.491: W/dalvikvm(2473): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-16 05:40:08.551: E/AndroidRuntime(2473): FATAL EXCEPTION: main
12-16 05:40:08.551: E/AndroidRuntime(2473): java.lang.NullPointerException
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.app.AlertController$AlertParams.&lt;init&gt;(AlertController.java:743)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.app.AlertDialog$Builder.&lt;init&gt;(AlertDialog.java:273)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.b00517566.la.MyItemizedOverlay.onTap(MyItemizedOverlay.java:46)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:347)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:647)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.View.dispatchTouchEvent(View.java:3766)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)

12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)

12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.os.Looper.loop(Looper.java:123)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at android.app.ActivityThread.main(ActivityThread.java:4627)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at java.lang.reflect.Method.invokeNative(Native Method)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at java.lang.reflect.Method.invoke(Method.java:521)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-16 05:40:08.551: E/AndroidRuntime(2473):     at dalvik.system.NativeStart.main(Native Method)
12-16 05:40:11.023: I/Process(2473): Sending signal. PID: 2473 SIG: 9
</code></pre>

<p>EDIT</p>

<pre><code>    package com.bleh.la;

    import java.util.ArrayList;

    import android.app.AlertDialog;
    import android.content.Context;
    import android.graphics.drawable.Drawable;

    import com.google.android.maps.ItemizedOverlay;
    import com.google.android.maps.OverlayItem;

     public class MyItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {


private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();
Context mContext;


public MyItemizedOverlay(Drawable defaultMarker) {
      super(boundCenterBottom(defaultMarker));
    }

public void addOverlay(OverlayItem overlay) {
    mOverlays.add(overlay);
    populate();
}

@Override
protected OverlayItem createItem(int i) {
  return mOverlays.get(i);
}

@Override
public int size() {
  return mOverlays.size();
}

public MyItemizedOverlay(Drawable defaultMarker, Context context) {
      super(defaultMarker);
      mContext = context;
    }

@Override
protected boolean onTap(int index) {
  OverlayItem item = mOverlays.get(index);
  AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
  dialog.setTitle(item.getTitle());
  dialog.setMessage(item.getSnippet());
  dialog.show();
  return true;
}
    }
</code></pre>
