the application stopped unexpectedly while search the area in map error occur in android
<p>I can view the map in android mobile now i put one edit text for search area. And create one button for search the place </p>

<pre><code>enter code here
  public class MapActivity extends com.google.android.maps.MapActivity implements
    OnClickListener {
/** Called when the activity is first created. */
MapView view;
Button search;
EditText location;
MapController controller;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    view = (MapView) findViewById(R.id.themap);
    location = (EditText) findViewById(R.id.editText1);
    search = (Button) findViewById(R.id.search);
    search.setOnClickListener(this);
    view.setBuiltInZoomControls(true);
}

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

public void onClick(View v) {
    // TODO Auto-generated method stub
    if (v == search) {
        Geocoder geo = new Geocoder(getApplicationContext(),
                Locale.getDefault());
        try {
            List&lt;Address&gt; addresses = geo.getFromLocationName(location
                    .getText().toString(), 5);
            if (addresses.size() &gt; 0) {
                GeoPoint p = new GeoPoint((int) (addresses.get(0)
                        .getLatitude() * 1E6), (int) (addresses.get(0)
                        .getLongitude() * 1E6));

                controller.animateTo(p);
                controller.setZoom(12);
                MapOverlay mapOverlay = new MapOverlay();
                List&lt;Overlay&gt; lisOverlays = view.getOverlays();
                lisOverlays.clear();
                lisOverlays.add(mapOverlay);

            } else {
                AlertDialog.Builder adb = new AlertDialog.Builder(
                        MapActivity.this);
                adb.setTitle("Google Map");
                adb.setMessage("please provide proper place");
                adb.setPositiveButton("Close", null);
                adb.show();
            }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}
  }
 Mapoverlay.java
  public class MapOverlay extends com.google.android.maps.Overlay {
Context context;

public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
        long when) {
    super.draw(canvas, mapView, shadow);
    Point screenPts = new Point();
    GeoPoint p = null;
    mapView.getProjection().toPixels(p, screenPts);
    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),
            R.drawable.ic_launcher);
    canvas.drawBitmap(bitmap, screenPts.x, screenPts.y, null);

    return true;

}

 }
</code></pre>

<p>My log cat shows error in controller.animateTo(p); </p>

<p>How can i solve the error in the above line.
How do i provide search option in the map.
Could someone tell me where the mistake is in the above code?</p>
